I don't know if something is possible with your package so I'm just asking right away is it supported to create shorter URL's? For example if you have a Folder structure in the backend and don't want to reflect that in the frontend.
To avoid creating a new route for every article, you can set up a more generic route:
Let's assume that all the articles use the same Document Type whose alias is "article" and that you have only 2 articles whose names are: "my awesome article" and "most awesome article"
For any other Url, since there are no more articles, the routing engine will not be able to find an article and will fall back on Umbraco's routes. This is because no fallbacknodeid was setup in the route config.
If you set up a fallbackNodeId then any other Url would display the fallbackNodeId. Since this is the website root url that wouldn't be the best practice.
In this case the Urls below will redirect to the node id 1630 (FallbackNodeId) that could be a landing page with a listing of all available articles, for example.
If in the future you create a new article whose name is "k3xasdddddcm" then the routing engine will detect it and the url "http://www.domain.com/article/k3xasdddddcm" would display this content node instead of the fallbacknodeid.
@Sören, thanks for the reply! The downside is that you need to hook the umbraco Event API and overwrite this property to provide an alternative route. So something Alen described is pretty just right now would be kind of amazing.
@Alan That's, as already stated above, AMAZING. I will definitelly us this package just because of this feature. Thats really awesome! Keep up the great work!
I just want to clarify (as Sören said) that umbracoUrlAlias is another option. Further, I would say that it is the option to consider for simple scenarios.
This package has been created to handle more complex scenarios like:
huge amount of urls
urls managed automatically
necessary to have a fallback landing pages in the case that a url is not correct or has changed
assign dynamically umbraco templates or full path views (~/views/mysubfolder/myview.cshtml) for some routes and/or document types
Short Url's
Hi Alain,
I don't know if something is possible with your package so I'm just asking right away is it supported to create shorter URL's? For example if you have a Folder structure in the backend and don't want to reflect that in the frontend.
Folder Structure: Previews\Year\Month\Week\ArticleName
Current Url: http://www.domain.com/previews/2015/februaray/my-awesome-article
Short Url: http://www.domain.com/my-awesome-article
Best Regards,
Helmuth
Hi Helmuth,
Should it not be possible with the package, you can use the default umbracoUrlAlias in document types:
https://our.umbraco.org/wiki/reference/umbraco-best-practices/umbracourlalias
Best,
Sören
Hi Helmuth,
This is one of the goals of the package.
If the nodeId for the content "my-awesome-article" is 1290, then the following route will do it.
If you have more than one article you could do:
To avoid creating a new route for every article, you can set up a more generic route:
Let's assume that all the articles use the same Document Type whose alias is "article" and that you have only 2 articles whose names are: "my awesome article" and "most awesome article"
The following urls will display properly both articles:
For any other Url, since there are no more articles, the routing engine will not be able to find an article and will fall back on Umbraco's routes. This is because no fallbacknodeid was setup in the route config. If you set up a fallbackNodeId then any other Url would display the fallbackNodeId. Since this is the website root url that wouldn't be the best practice.
The fallbackNodeId is more for scenarios like:
with a route config like
In this case the Urls below will redirect to the node id 1630 (FallbackNodeId) that could be a landing page with a listing of all available articles, for example.
If in the future you create a new article whose name is "k3xasdddddcm" then the routing engine will detect it and the url "http://www.domain.com/article/k3xasdddddcm" would display this content node instead of the fallbacknodeid.
Hope that helps.
Best,
Alain
@Sören, thanks for the reply!
The downside is that you need to hook the umbraco Event API and overwrite this property to provide an alternative route. So something Alen described is pretty just right now would be kind of amazing.
@Alan
That's, as already stated above, AMAZING. I will definitelly us this package just because of this feature. Thats really awesome! Keep up the great work!
Regards,
Helmuth
Helmuth, thanks and glad it is useful!
I just want to clarify (as Sören said) that umbracoUrlAlias is another option. Further, I would say that it is the option to consider for simple scenarios.
This package has been created to handle more complex scenarios like:
Alain
Hi Alain,
Its Working for me.
Thanks
is working on a reply...