Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • SaphuA 124 posts 87 karma points
    Apr 15, 2009 @ 16:18
    SaphuA
    0

    Navigation

    Hi,

    I've only just started to work with XSLT to get some stuff done in Umbraco.

    I've installed Runway to use as a basis. I immediatly didn't like how it uses the Home page as the root to create navigation from. However, after reading some posts I saw some people say it's 'best practice'. What's up with that?

    Does anyone have a sample of navigation without using a root page?

    Thanks!

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 15, 2009 @ 16:47
    Douglas Robar
    0

    There are samples on the forum you can search for. But really, what's the problem?

    You'll notice that this is simply a matter of convenience for organization because (by default) umbraco hides the top level node from the URL. This is changable with the setting in the /web.config file.

    With it set to "true" you get these url's from this structure in the content tree of umbraco:
    [code]CONTENT
    - Home (/home.aspx)
    - - Products (/products.aspx)
    - - - Foo (/products/foo.aspx)
    - - - Bar (/products/bar.aspx)
    - - About Us (/about-us.aspx)
    - - - Contact Us (/about-us/contact-us.aspx)[/code]
    I think you get the idea... only the "home" node is hidden from the url because it is a top-level node. Most of the examples and for navigation and such will assume such a structure.

    But you can certainly make a different structure if you like! That's the beauty of umbraco.

    Set the value to "false" and you can have a structure like this:
    [code]CONTENT
    - Home (/home.aspx)
    - Products (/products.aspx)
    - - Foo (/products/foo.aspx)
    - - Bar (/products/bar.aspx)
    - About Us (/about-us.aspx)
    - - Contact Us (/about-us/contact-us.aspx)[/code]

    You'll just have to keep an eye on your xpath statements in xslt.

    Oh, if you change the value of the setting you'll want to publish all the nodes and their children to force umbraco to recalculate the urls.

    cheers, and welcome to umbraco!
    doug.

  • SaphuA 124 posts 87 karma points
    Apr 15, 2009 @ 17:29
    SaphuA
    0

    Thanks for your reply.

    The main reason I didn't like this is because Home is missing from the navigation. And it just doesn't make sence, a home page is a page like any other not some directory.

    And if I may, another question:
    The xslt contains the following line:


    Where is this parameter set? Is it something Umbraco does by default? Are there are docs on this?

    Thanks again.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 15, 2009 @ 17:59
    Douglas Robar
    0

    Yes, it is a page like any other... though in most sites it is rather unique. And when you're building multi-language sites this structure is even more helpful. Still, I see your point and that's part of umbraco's flexibility. You're free to do it any way you like!

    As for $currentPage... check out these two resources:
    [url]http://blog.percipientstudios.com/2009/4/11/anatomy-of-an-umbraco-xslt-file.aspx[/url]

    [url]http://umbraco.org/documentation/books/xslt-basics/understanding-currentpage[/url] (the whole book is excellent, especially the last section on xpath statements)

    cheers,
    doug.

Please Sign in or register to post replies

Write your reply to:

Draft