We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7869
    • 118 Posts
    Is there a snippet available that will show only links for the root level and the immediate children (not grandchildren) of whatever location I’m at. Take this page for example: http://demo.opensourcecms.com/modx/

    On the right side in the Pages section there is Quickstart Guide and its children (Script.aculo.us, DropMenu, QuickEdit). Rather than seeing those children, I would prefer that the text Quickstart Guide look like a link and only display those children AFTER it was clicked. Then any of those children should look like links and only display their children AFTER they get clicked.

    The reason I want this is so the menu/nav does not make the page so long that a person has to scroll to see all the root-level links. Hope that makes sense.
      -Dorian
      • 15987
      • 786 Posts
      You can use Wayfinder with the parameter &hideSubMenus=`1` it should do what you want
        • 7869
        • 118 Posts
        It did do what I want and nicely. Thanks.
          -Dorian
          • 7869
          • 118 Posts
          It only shows the first 30 characters of each page’s title. I can’t find the place to edit this for something longer such as 50 characters.
            -Dorian
          • That’s because by default it uses the "menutitle", which is (was?) restricted to 30 chars. If you want to use the pagetitle, there is another option you can use in the snippet call to tell it which field to use for the link text.
              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
              • 7869
              • 118 Posts
              Thanks! If anyone else is interested in making this same change it’s easy. Simply add the following parameter in your call to the Wayfinder snippet. This will force it to use the document’s Long Title rather than the defaulted Menu Title.

              [[Wayfinder? &textOfLinks=`longtitle`]]


              PS: Maybe someone with more experience can help me. What is the difference with quotes " " and backticks ` ` ?
              My original code edit used quotes like this "longtitle" and it worked for each page except the home page (with id #1). Changing to it `longtitle` fixed that, but not sure why. Please explain because I can’t find the answer on Google.
                -Dorian