Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grouping umbraco pages in folders without affecting URL

Tags:

umbraco

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?

like image 702
Steve Temple Avatar asked May 09 '13 15:05

Steve Temple


1 Answers

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:

  • umbracoRedirect (content picker) - Umbraco will redirect to the picked page
  • umbracoInternalRedirectId (content picker) - Umbraco will load the picked page without changing the url
  • umbracoUrlName (textstring) - Umbraco will override the page’s default url
  • umbracoUrlAlias (textstring) - You can have several urls for the same page (not sure when this is useful)

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.

like image 157
amelvin Avatar answered Nov 08 '22 09:11

amelvin