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

    I’m trying to get a menu like this:
    - Parent
    - Child 1
    - Child 2
    


    In this case the Parent item should be a normal menuitem like the childs.
    Also, stuff like "active/selected" should be applied on that object as well.

    Is this possible?
    I am currently using this WayFinder call:
    [!Wayfinder?startId=`[[UltimateParent]]` &outerTpl=`OuterTplSide` &innerTpl=`InnerTplSide` &rowTpl=`RowTplSide` &innerRowTpl=`InnerRowTplSide` &hereClass=`selected` &lastClass=`` &sortBy=`menuindex`!]
    


    I tried &includeDocs to contain the UltimateParent but this breaks the whole menu.

    Any hints on how I can achieve this?
      • 26931
      • 2,314 Posts
      Hi Sypher,

      i guess the solution to your problem is in this thread ( parameter: &displayStart=`true` ):
      http://modxcms.com/forums/index.php/topic,38946.0.html

      -> http://modxcms.com/forums/index.php/topic,38946.msg234905.html#msg234905
        • 27708 MODX Staff
        • 2,502 Posts
        You need to include the start item (the document that is the startId). By default it will be an H2 and not a link so you will need to use a special template for the start item. What I do is copy the row tpl and make the necessary changes (I usually never want the start parent to be active at the same time in this type of menu).

        [!Wayfinder? &displayStart=`1` &startItemTpl=`startTpl` &startId=`[[UltimateParent]]` &outerTpl=`OuterTplSide` &innerTpl=`InnerTplSide` &rowTpl=`RowTplSide` &innerRowTpl=`InnerRowTplSide` &hereClass=`selected` &lastClass=`` &sortBy=`menuindex`!]
        


        See: http://www.muddydogpaws.com/development/wayfinder/parameters.html
          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
          • 29107
          • 9 Posts
          I am using the displayStart & startItemTpl and it is working sort of ok, but...
          The main menu item always has the "active/selected" status even when a child is selected.

          Is there any way to get rid of that behaviour?
            • 27708 MODX Staff
            • 2,502 Posts
            You may need to create an &activeParentRowTpl and customize it so it doesn’t have the wf.classes. I have found it takes trial and error. Make sure you look at all the options in the Wayfinder docs.

            Cheers,

            Jay
              Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              There are two classnames to use for "active" pages, one for self (the actual page being viewed) and one for active (the page being viewed and all of its parents).
                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
                • 29107
                • 9 Posts
                Quote from: sottwell at Nov 15, 2009, 05:58 AM

                There are two classnames to use for "active" pages, one for self (the actual page being viewed) and one for active (the page being viewed and all of its parents).

                Thanks! This is the trick smiley
                Replacing "hereClass" with "selfClass" solved my problem smiley

                Must have overlooked it, since I did read the parameters.

                Thanks all!
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I have the cheatsheet from the old wiki page. Makes life so much easier!
                    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