We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13736
    • 345 Posts
    Perhaps this has been asked before, but a search didn’t turn up what I wanted.

    Is it possible to start a menu list from the current folder and display a single level.

    So for example I might have a document tree like this...
    Home
    About
    Photos
    -- Portraits
    -- Landscapes
    -- ... Mountains
    -- ... Lakes
    -- ... Oceans
    -- Dogs
    -- Cats
    Contacts

    If I’m on the Photos page the sub menu would display Portraits, Landscapes, Dogs, Cats. If I click on Landscapes, then the menu would output Mountains, Lakes, Oceans.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Sure. Just use [*id*] as the startId value instead of a document ID number.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 13736
        • 345 Posts
        Brilliant. I should have thought of that.
          • 15987
          • 786 Posts
          You can also just remove the startId parameter from your snippet call, if none is specified it will use the current document ID as the default.
            • 13736
            • 345 Posts
            When I removed the startID parameter nothing was output. That was what I originaly tried.
              • 15987
              • 786 Posts
              Hmmmmmm.... Thats strange, if no id is specified it should use the current doc and display all children. Can you post your whole snippet call, maybe I can figure out why that doesn’t work for you.
                • 13736
                • 345 Posts
                Well, there’s not much to post. When I first tried the Wayfinder snippet I just stuck the plain tag in there by itself. Then when nothing was output, I started looking through the different tags to figure out what needed to be added. Realized that adding the docID tag would get it to display. Here’s the current tag I’ve got going.

                [!Wayfinder? &startId=`[*id*]` &level=`1` &outerTpl=`wfOuterSecondarynav`!]


                Works perfectly. And if I simply remove the &startId=`[*id*]` then is stops working perfectly and outputs nothing at all. Source code on the page shows and empty line instead of a list.
                  • 22221
                  • 283 Posts
                  Hello, I’ve try to modify the main menu of the 0.9.5 beta default template, and I’ve some problem with category folders.

                  1 - I’ve empty the document "Template" of the demo site and rename it "Forum"
                  2 - I’ve set the Template of this Foder (Forum) to blank and add the rel="category" in link attribute
                  3 - I’ve add the option &categoryFoldersTpl=`wfCatTpl` and the debug option in the snippet call
                  4 - I’ve add the chunk with a sample text like <li[+wf.classes+]>[+wf.wrapper+]</li>

                  5 when I load the main page, I see the debug message (the chunk wfCatTpl is loaded) but the "Forum" item has the default template.

                  I don’t understant why it doesn’t work ?

                  Any Idea ?
                    • 15987
                    • 786 Posts
                    OncleBen31,
                    I just tried the steps you wrote and it worked fine for me, can you post the snippet call. I’m not sure why its not picking up the category folders template. Also, do you have a link where I can see the debug output.

                    jbjones,
                    When I do not include the startId it works just fine for me, can you turn on the debug output and see what it says the start Id is?
                      • 14281
                      • 120 Posts
                      I’d like to request a feature for Wayfinder. It would be nice if you could choose what field the menu items will be sorted by.

                      This discussion is closed to further replies. Keep calm and carry on.