Copied to clipboard

Flag this post as spam?

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


  • Tom Maton 387 posts 660 karma points
    Feb 18, 2009 @ 17:53
    Tom Maton
    0

    Getting child pages from parent node

    Hi All,

    I am relativley new to XSLT and I am looking to build a navigation with the top level and if there are 2nd levels retrieve them and place into a

      list within the


    • The code I have so far below is:

      [code]










    • [/code]

      this gets my top level nav and builds my second level but returns all my second level not the ones specified for that link.

      I have built the HTML version here http://templates.precedenthost.co.uk/gap/ - click on the top level nav for an example

      Any help would be greatly appreciated.

      Tom

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 18, 2009 @ 18:06
    Dirk De Grave
    0

    Hi,

    I'm thinking you need to replace

    [code]



  • [/code]

    with

    [code][/code]

    ($currentPage replaced with '.' sign, meaning to iterate child nodes of the current node processed in the outer for-each loop)

    Does that do the trick?

    Regards,
    /Dirk

Copy Link
  • Tom Maton 387 posts 660 karma points
    Feb 18, 2009 @ 18:17
    Tom Maton
    0

    thanks for the quick reply, but for some reason that replaces the top nav with the first item in my content tree and the item dropping under is my next page.

    eg the only llink at the top is CONSULTANT and the navigation underneath is DEVELOPMENT.

    Tom

    Copy Link
  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 18, 2009 @ 18:24
    Dirk De Grave
    0

    Tom,

    I now think it's better to post the content tree structure and the current output/desired output...

    Regards,
    /Dirk

    Copy Link
  • Tom Maton 387 posts 660 karma points
    Feb 18, 2009 @ 18:35
    Tom Maton
    0

    This is the tree structure



    basically I want the following to be top level (Which I can do no problem):

    Consulting
    Development
    Insight
    About Us
    Contact Us

    And what I need from the child nodes is when I say click on the "development" link the "development" child nodes appear in the list underneath and when I click the "Insight" link the "insight" child nodes appear.

    I hope I have described it ok

    Tom

    Copy Link
  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 18, 2009 @ 20:49
    Dirk De Grave
    0

    Ok got it now, understand the issue.

    Let's dissect the xslt...







  • [/code]

    Above code snippet will not render the second level nav if you're on the 'Runway Homepage'. If you click on any of the nav items (Consulting, Development, ...), it will.

    Hope this helps.

    Regards,
    /Dirk

    Copy Link
  • Tom Maton 387 posts 660 karma points
    Feb 19, 2009 @ 11:53
    Tom Maton
    0

    cheers Dirk, that worked a treat. Thanks

    Copy Link
  • Please Sign in or register to post replies

    Write your reply to:

    Draft