I am trying to create a simple top level menu based on the "List Sub Pages By Level" XSLT. Unfortunately I simply can't get it to work the way I wanted.
Here's my site structure as displayed in the Content section:
...and so forth. Basically I want a vertical menu to show:
Page 1 Page 2 Page 3
I can cheat this by shifting every page one level deeper and display the menu starting from the the new "top level" node immediately below "Content". Unfortunately this doesn't work with the Breadcrumb macro which uses "/" as the URL for the "Home" item. This also displays the container top level node when someone accesses the site without specifying any page.
I hope I have explained this clearly. Any suggestions or hints would be greatly appreciated.
"I can cheat this by shifting every page one level deeper and display the menu starting from the the new "top level" node immediately below "Content"."
--> that is how most people structure their site, and it's IMHO umbraco best practice to do so.
"Unfortunately this doesn't work with the Breadcrumb macro which uses "/" as the URL for the "Home" item"
--> Haven't tried that, but don't think it would become a problem
"This also displays the container top level node when someone accesses the site without specifying any page."
--> Add an extra property umbracoRedirectId (type = content picker) to that 'Container top level' node, and select first node ('Page 1'). Doing so will allow to redirect to that page when someone browses to the 'Container' page
Thank you very much for your suggestion. I have done everything but it seems adding a property called umbracoRedirectId did not automatically redirect to the selected page when I use http://site/ URL.
Forgot to add that, having seen googled this a little more, I have also tried adding a property called umbracoRedirect of the Content Picker type. This didn't do anything either. Both umbracoRedirectId and umbracoRedirect didn't raise any errors - it simply did not display any page - just blank.
Great suggestion! As it turns out there was an error saying: "Master template is the same as the current template. It would course an endless loop!". When I created the Document Type for this redirecting page I did not create a matching template!
What's the best practice here? Do I create a blank template? or can I use some other random template?
Ok, this is really baffling me - here's my Template structure:
Base RedirectingPage (only has a blank <asp:content> element) SimpleContent (has umbraco fields in the <asp:content> element)
My DocumentTypes are:
RedirectingPage (using RedirectingPage template, has the umbracoRedirectId field of Content Picker type) SimpleContent (using the SimpleContent template)
RootLevel node has its umbracoRedirectId field set to Page 1. It all seems simple and straightforward to me - yet I am still getting the "Master template is the same as the current template..." error. I have republished the whole structure, even re-started IIS, all to no avail. Still the same error.
I'm utterly stumped on this one - can someone please give me a hint on what I have missed?
Don't think you need a RedirectingPage template to be set on RedirectingPage doc type. Could you switch templates (ie setting no template) for those RedirectingPage documents (it might be a collision of template/redirecting that makes it behave that odd)
Hi again Dirk, I have experimented some more on this. I have unset any template from the RedirectingPage doc type, and even deleted the RedirectingPage template completely. I then republished the whole site but this hasn't made any difference.
I made another node, so now my Content structure looks like:
If I navigate to http://localhost it correctly forwards to the page-1.aspx URL but then there's the template error again. If I try http://localhost/page-2.aspx there's also the template error. However, if I try http://localhost/test.aspx the page displays correctly! I think you're right - it's something to do with the redirection but I don't know enough about the inner workings of Umbraco to figure this out...
Strange as it may seem suddenly it all started working! I shut down the dev VM and left it alone for a few days. Last night I returned to it to have another go at it, and it was already working. Strange - perhaps it was some peculiar IIS/Umbraco caching issues that was flushed with the restart? Not sure...
Listing SubPages pages at a certain level
Hi folks,
I am trying to create a simple top level menu based on the "List Sub Pages By Level" XSLT. Unfortunately I simply can't get it to work the way I wanted.
Here's my site structure as displayed in the Content section:
Content
Page 1
Page 1.1
Page 1.2
Page 2
Page 3
Page 3.1
Page 3.2
...and so forth. Basically I want a vertical menu to show:
Page 1
Page 2
Page 3
I can cheat this by shifting every page one level deeper and display the menu starting from the the new "top level" node immediately below "Content". Unfortunately this doesn't work with the Breadcrumb macro which uses "/" as the URL for the "Home" item. This also displays the container top level node when someone accesses the site without specifying any page.
I hope I have explained this clearly. Any suggestions or hints would be greatly appreciated.
Many thanks,
Dany.
You can use the @level attribute, here is a sample:
Hi Dany,
"I can cheat this by shifting every page one level deeper and display the menu starting from the the new "top level" node immediately below "Content"."
--> that is how most people structure their site, and it's IMHO umbraco best practice to do so.
"Unfortunately this doesn't work with the Breadcrumb macro which uses "/" as the URL for the "Home" item"
--> Haven't tried that, but don't think it would become a problem
"This also displays the container top level node when someone accesses the site without specifying any page."
--> Add an extra property umbracoRedirectId (type = content picker) to that 'Container top level' node, and select first node ('Page 1'). Doing so will allow to redirect to that page when someone browses to the 'Container' page
Hope this helps.
Regards,
/Dirk
Hi Dirk,
Thank you very much for your suggestion. I have done everything but it seems adding a property called umbracoRedirectId did not automatically redirect to the selected page when I use http://site/ URL.
Is there a step I have missed somewhere?
Cheers,
Dany.
Do you have a page set for the umbracoRedirectId property?
Forgot to add that, having seen googled this a little more, I have also tried adding a property called umbracoRedirect of the Content Picker type. This didn't do anything either. Both umbracoRedirectId and umbracoRedirect didn't raise any errors - it simply did not display any page - just blank.
D.
Yup, I have set the property value to the appropriate page.
It might be a good idea to add some trace output to the page using ?umbdebugshowtrace=true and see if the umbraco request handler picks up anything?
Great suggestion! As it turns out there was an error saying: "Master template is the same as the current template. It would course an endless loop!". When I created the Document Type for this redirecting page I did not create a matching template!
What's the best practice here? Do I create a blank template? or can I use some other random template?
Ok, this is really baffling me - here's my Template structure:
Base
RedirectingPage (only has a blank <asp:content> element)
SimpleContent (has umbraco fields in the <asp:content> element)
My DocumentTypes are:
RedirectingPage (using RedirectingPage template, has the umbracoRedirectId field of Content Picker type)
SimpleContent (using the SimpleContent template)
My Content structure looks like:
RootLevel (of RedirectingPage DocType)
Page 1 (SimpleContent)
Page 2 (SimpleContent)
RootLevel node has its umbracoRedirectId field set to Page 1. It all seems simple and straightforward to me - yet I am still getting the "Master template is the same as the current template..." error. I have republished the whole structure, even re-started IIS, all to no avail. Still the same error.
I'm utterly stumped on this one - can someone please give me a hint on what I have missed?
Many thanks,
Dany.
Hi Dany,
Don't think you need a RedirectingPage template to be set on RedirectingPage doc type. Could you switch templates (ie setting no template) for those RedirectingPage documents (it might be a collision of template/redirecting that makes it behave that odd)
Let us know if that works out.
Cheers,
/Dirk
Hi again Dirk, I have experimented some more on this. I have unset any template from the RedirectingPage doc type, and even deleted the RedirectingPage template completely. I then republished the whole site but this hasn't made any difference.
I made another node, so now my Content structure looks like:
Content
RootLevel
Page 1 (SimpleContent type)
Page 2 (SimpleContent type)
Test (SimpleContent type)
If I navigate to http://localhost it correctly forwards to the page-1.aspx URL but then there's the template error again. If I try http://localhost/page-2.aspx there's also the template error. However, if I try http://localhost/test.aspx the page displays correctly! I think you're right - it's something to do with the redirection but I don't know enough about the inner workings of Umbraco to figure this out...
Cheers,
D.
Strange as it may seem suddenly it all started working! I shut down the dev VM and left it alone for a few days. Last night I returned to it to have another go at it, and it was already working. Strange - perhaps it was some peculiar IIS/Umbraco caching issues that was flushed with the restart? Not sure...
is working on a reply...