Copied to clipboard

Flag this post as spam?

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


  • mkjones 31 posts 20 karma points
    May 13, 2009 @ 11:29
    mkjones
    0

    Really simple 2nd tier navigation driving me a bit crazy...

    Hey everyone :-s

    I've got a very basic structure like this:

    Home

    -About
    --About stuff
    --More Stuff

    -Life
    --About Life
    --Life Stuff

    -Death
    --About Death
    --Death Stuff

    -Love
    --Love stuff
    --More Love

    The top level links (About, Life etc) are in the header area of the site. With their sub-pages in a left hand navigation area.

    Using this code it works great :)

    [code]
    ]>

    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">















    [/code]

    BUT if a user wanted to do this:

    -About
    --About stuff
    ---This is more stuff
    ---I love stuff
    ---Another just to annoy you
    --More Stuff

    How would I go about modding the code?

    Everything I've tried has messed up and the only way I could get it to work even close to what I want was to display the entire navigation structure in the left hand navigation.

    Hope you get what I mean #-o

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    May 13, 2009 @ 11:47
    Dirk De Grave
    0

    Hi,

    I'd guess you need an extra for-each loop...

    [code]


    [/code]

    In above code, should also check whether there are still child nodes (otherwise, you'll get an empty
      tag).
      If you need extra levels of navigation (3rd, 4th), consider recursion)

      I know of a great package which has all those features in one single package: http://packages.maliciousthinktank.com/navdemo.aspx

      Cheers,
      /Dirk

    • This forum is in read-only mode while we transition to the new forum.

      You can continue this topic on the new forum by tapping the "Continue discussion" link below.

    Please Sign in or register to post replies