We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38304
    • 68 Posts
    I really don't like this attempt,... its something like working, but not very cool with 3 wayfinders...
    My baddest thing here is that selecting an item of the submenue will switchoff the highlight of the mainmenuitem.

    You see that the subs are subitems of the parent 23.

    I want to have (if possible) less wayfinders... and especially an highlighted mainmenue(23) when selecting one of the subs.

    I think with one wayfinder it would be possible by Parent... but with different wayfinders i can't get any clue how to do it.

    Thank you.

    Maybe there is a simple possibility to say "hey i am a sub of 23, so add "selected class" also to 23.
    The hard thing is for me, that this are 3 different wayfinders i cant get over the class.

    Maybe i miss a really easy thing, i cant image yet.

    Thank you for maybe help...


    .....

    <div id="mainMenu">
    [[Wayfinder? &startId=`0` &rowTpl=`myRowTpl` &hereTpl=`myHereTpl` &hereClass=`[[+wf.alias]] selected` &outerClass=`left` &includeDocs=`16,17,18,19,20,21,22,43`]]
    [[Wayfinder? &startId=`0` &rowTpl=`myRowTpl` &hereTpl=`myHereTpl` &hereClass=`[[+wf.alias]] selected` &outerClass=`right` &includeDocs=`23,26`]]
    </div>
    </div>

    <div id="subMenu" class="about">
    [[Wayfinder? &startId=`23` &includeDocs=`391,392,393,394,395,396,397,398,399` &hereClass=`[[+wf.alias]] selected`]]
    </div>


    myRowTpl


    <li[[+wf.id]] class="[[+wf.alias]]"><a href="/[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>

    myHereTpl


    <li[[+wf.id]][[+wf.classes]]><a href="[[+wf.link]]" class="linkweiss" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]] </a>[[+wf.wrapper]]</li>

    Thank you!

    with best regards,
    Chris

    This question has been answered by theoretiker. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It looks to me like you need to re-think the organization of your resources in the Tree. The tree structure should basically represent your main menu structure.

      If you really need to build a menu out of such widely dispersed resources, set up a structure of symlinks. Symlinks are much like ordinary resources, except they pull their content from another resource that you specify rather than have content of their own. Symlinks and weblinks (which actually redirect to the specified page) exist to help organize menu structures.
        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
        • 38304
        • 68 Posts
        Thank you Susan!

        Yeah, i know that this is a bit rubbish. Thats why i asked for it... smiley

        The Structure is available as it is... and in the structure the menu is organised.

        I have a two collumn Mainmenue (left and right). On the left there has to be the most items... on the right side only two.

        First item of the left has some subs.... first item of the right has somne subs.

        The ressource structure is like this... first item of page (left) with id 16 is a ressourcefolder, first item of the right collumn (right) with 23 is a ressourcefolder too.
        So 16,23 has all that subitems.

        So the structure is already existant in Backend, the way you think of and recommended me.

        The cause of deviding into 3 wayfinders is that i have to adpat a existant webpage with structure (html) and layout (css) and i can't change anything in Frontend.

        So:
        <div id="mainMenu">... </div></div><div id="subMenu" class="xyz"></div> has to stay.

        with best regards,
        Chris



        [ed. note: theoretiker last edited this post 13 years, 7 months ago.]
          • 38304
          • 68 Posts
          Ok, so another attempt to get this done.

          Ahm, would somebody pleeeeease be so nice to translate this line of structure to an ONE wayfinder call / tpl chunks please, so i can help myself.

          <div id="mainmenu">level0 of menuestructure</div></div><div id="submenu">level1 for subs</div>

          Thank you!

          with best regards,
          chris



            • 10208 ☆ A M B ☆
            • 1,780 Posts
            Add an &parentClass to your Wayfinder call, and style it as needed. If 23 is the parent, it will use the class you specify.

            I'm a little curious if you need the includeDocs parameter. Are you excluding any resources? If they're children of the parent, Wayfinder doesn't need you to tell it to find and use them, it will do it automatically.
              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster
              • 42562
              • 1,145 Posts
              You prefer <div>s to <ul>s in creating a menu, any particular reason?
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • 38304
                • 68 Posts
                I ripped off the includedocs already...

                ahm, is it possible to do the divs via tpl chunks in this case instead of parent class?

                Thank you!
                  • 36926
                  • 701 Posts
                  Quote from: theoretiker at Feb 04, 2013, 10:15 AM

                  <div id="mainmenu">level0 of menuestructure</div></div><div id="submenu">level1 for subs</div>

                  Are those sub menus going to get repeated as you shouldn't use an id. Also you have 2 closing div's for id="main menu"

                  A screen show of your manager tree structure may help visuals what your trying to do.

                  Thinking you have it something like this:

                  Main menu left
                  - Item 1
                  -sub a
                  -sub b

                  -Item 2

                  -Item 3

                  -Item 4

                  -Item 5


                  Main menu Right
                  -Item 1
                  --sub a
                  --sub b

                  -Item 2
                    • 10208 ☆ A M B ☆
                    • 1,780 Posts
                    In your Wayfinder chunks, just use divs instead of ul and li.

                    But why would you want to bother with setting a new div for a parent, when Wayfinder will do it for you with a simple parameter? And how would you tell it which parent to use on every page?

                    I think most here would suggest that you use Wayfinder as it's intended, and set classes to exactly where you need them with the parameters instead of using a special div that can't be produced dynamically.

                    I also wonder why you need to use divs instead of ul and li.
                      Frogabog- MODX Websites in Portland Oregon
                      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                      Having server issues? These guys have MODX Hosting perfected - SkyToaster
                      • 38304
                      • 68 Posts
                      Its told by an active class. ("selected")

                      My job is to adapt a existing website and all of its structure and content to modx.

                      The rule is, "don't change" if you can do it the unchanged way.

                      You are right, i will consider the better way...


                      Thank you!

                      with best regards,
                      Chris [ed. note: theoretiker last edited this post 13 years, 7 months ago.]