One of our Umbraco sites is getting a bit messy and I was wondering if there was a way of grouping pages in folders without affecting the URL. So for example if under the homepage I have some top level sections, some footer links and various other system pages. I'd like to group the footer pages in a footer folder, the system pages in a system folder but I don't want all the URLs to become /footer/page1, system/contact etc.
Is there a nice way of doing this, maybe something with umbracoUrlName?
There are two answers, first you could turn on the 'hide root folder' option in web.config - then you can have as many folders in the root as you like - without them forming part of the url.
umbracoHideTopLevelNodeFromPath Causes the top level content items to be excluded from any url paths. For example, this is pre-set to True, so:
[Content]Home = /home.aspx or /home/
[Content]Home\Projects = /projects.aspx or /projects/
[Content]Footer\Page1 = /page1.aspx or /page1/
[Content]Home\Projects\About = /projects/about.aspx or /projects/about/
http://our.umbraco.org/wiki/reference/webconfig
Secondly there are four 'hidden' redirect fields on every umbraco node (which you can add into the document type) which can change the url routing:
So I guess in your scenario umbracoUrlName will pick out a page in your combined folder but with a url that you choose.
So you have
homepage
|- footer
|-page1 (umbracoUrl = "/footer-page1/")
and /footer-page1/ would render your page stored in the footer folder.
You could also hack things about and make umbracoRedirect & umbracoInternalRedirectId work but I'm not sure that it would help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With