We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10315
    • 4 Posts
    Hi all,

    I love modx but I’m having real problems understanding WF, even after going through all the documentation and forums.

    I’m trying to have 3 levels of navigation.. but each level of navigation would each be at a different area of the page.

    Here is the structure:

    ---------------------------
    MODx Site

    Home (1)

    Services (12)

    Voice (28)

    Product One (31)
    Product Two (32)
    Product Three (33) <-- You are here!
    Product Four (34)

    Networks (29)

    Hosting (30)

    Case Studies (23)

    About (24)

    Support (25)

    Investor Relations (26)

    Contact (27)

    ---------------------------

    I want a main menu at the top of the page with Home, Services, Case Studies, etc.

    I want a 2nd menu on the side of the page showing the children of main menu item I click on, to appear only when the main menu item has been clicked. This would be for example Voice, Hosting, Networks.

    And I want a 3rd menu elsewhere on the page to show the children of the above 2nd menu to appear only when the main menu item has been clicked. This would be for example Product 1, Product 2, etc.

    I have managed to get the 1st and 2nd levels working correctly but the 3rd menu is not working as it should.

    When I click on Services in the 1st menu, the 3rd menu is showing Voice, Hosting, Networks when it should actually show nothing. It should show Product 1, Product 2 only after I have clicked on Voice.

    What I am using to call the 3 menus at the moment is :

    [!Wayfinder? &config=`nsmenu1` &startId=`0`!]

    [!Wayfinder? &config=`nsmenu2` &startId=`[[UltimateParent? &topLevel=`1`]]`!]

    [!Wayfinder? &config=`nsmenu3` &startId=`[[UltimateParent? &topLevel=`28`]]`!]

    each config has: $level = 1; $hideSubMenus = true; inside it.

    There is 1 thing that works.. and that is if I use $excludeDocs = ’28,29,30’; inside the 3rd menu’s config file. This does the job but it would be good to have a better way.. Something like a $hideParentMenus function would work. smiley

    I’m also trying to highlight the page down the tree by using different $hereTpl code in each config, this highlight the menu item of the page I’m currently on but once you go further into the tree the highlighted item goes back to normal.

    Can anyone help me with this?

    Thanks muchly!

    Fusey
      • 7923
      • 4,213 Posts
      instead of using the ultimateparent snippet in startId, use [*id*].. then it should list the docs under that currently selected page for &level amount of levels..


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 10189
        • 109 Posts
        Suppose you click one of the links for a sub page, wouldn’t that mean that [*id*] will reflect that current page, essentially making the sub nav disappear?
          • 7923
          • 4,213 Posts
          Yes ofcourse, should probably pay more attention when answering.. sorry smiley

          but yeah.. the topLevel parameter is to define how many levels deep the top document can be, so you would probably want to use:

          [!Wayfinder? &config=`nsmenu1` &level=`1` &startId=`0`!] <-- get’s the first level from the site root

          [!Wayfinder? &config=`nsmenu2` &level=`1` &startId=`[[UltimateParent? &topLevel=`2`]]`!] <-- get’s second level from the ultimate parent of the current document at 2 levels deep in the document hierarchy

          [!Wayfinder? &config=`nsmenu3` &level=`1` &startId=`[[UltimateParent? &topLevel=`3`]]`!] <-- get’s third level from the ultimate parent of the current document at 3 levels deep in the document hierarchy


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 10315
            • 4 Posts
            Thanks guys for your replies..

            Due to real life getting extreamly busy the day after I posted the questions, I had to leave my project for some time so I’ve not had chance to play with it at all sad

            But I wanted to post just to thank you smiley

            Will post again when I finally get back to it!

            Fusey