We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12793
    • 293 Posts
    I’ve a start HTML page with 2 links.... each link need to open my MODX but with differents menu

    In my modx portal I’ve :

    Menu 1
    Menu 2
    Common Menu

    Menu 1 and Menu 2 is set from a start page (and contain informations about the products type selected)
    Common Menu is a standard menu (about, contacts, ....)


    In manager area I’ve created my menus

    Menu 1 (father) with all items (documents/pasge)
    Menu 2 (father) with all items (documents/pages)
    Common menu (father) with all items (about document, contacts document....)


    In my template I’ve to show:

    Common Menu on the left side
    Menu 1 OR Menu 2 on top area


    I’ve created a start page with 2 links: now I want to open
    with link1: CMS with Menu1+Common Menu
    with link2: CMS with Menu2+Common Menu

    Can you help me for find the best solution for this?

    Thanks
      • 12793
      • 293 Posts
      I don’t know how to resolve this problem... are many days that I’m trying to resolve it?

      Thanks
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        In the sections for 1 and 2, use a Wayfinder call with [[UltimateParent]] as the startId value.
        [!Wayfinder? &startId=`[[UltimateParent]]` ...]]

        Note that the Wayfinder call is uncached, while the UltimateParent snippet is cached.
          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
          • 12793
          • 293 Posts
          Thanks for reply!!

          I’m trying your solution


          [[!Wayfinder? &startId=`[[UltimateParent]]` &level=`2` &parentClass=`hide` &parentRowTpl=`cssplay_parentRow` &outerTpl=`cssplay_outer` &innerTpl=`cssplay_inner` &rowTpl=`cssplay_row` &outerClass=`menu` &cssTpl=`cssplay_dropdown`]]

          but I don’t know what I’ve to insert in

          &startId=`[[UltimateParent]]`

          for manage an index.php page with a paramter 1 or 2 .... where 1 and 2 are the fahter ID of 2 menus

          Note that I’ve to keep with view (only 1 menu) also in all other pages... I mean that when a user select item of menu 1 (or 2) need to show menu 1 layout (or menu 2)


          Thanks
            • 12793
            • 293 Posts
            Please help me!!! sad(((
              • 12793
              • 293 Posts
              I’ve installed the snippet, in menu template I’ve

              [[!Wayfinder? &startId=`[[UltimateParent]]` &level=`2` &parentClass=`hide` &outerTpl=`cssplay_outer` &innerTpl=`cssplay_inner` &rowTpl=`cssplay_row` &outerClass=`menu` &cssTpl=`cssplay_dropdown`]]

              but I don’t show menu in my home page ... how (and where) Can I set the menu to show?? (startId = 1 or 2)

              Thanks
                • 22427
                • 793 Posts
                I don’t know what your class "hide" defines (perhaps display: none ?) - but the value of the Parameter &parentClass will appear in the wf.classnames of every row which is a parent, i.e. has children. So it seems you hide all the menu items having children, what likley are most of them...
                  • 12793
                  • 293 Posts
                  Thanks for your reply!!

                  I’ve tried to delete "hide" value, now I’ve:


                  [[!Wayfinder? &startId=`[[UltimateParent]]` &level=`2` &outerTpl=`cssplay_outer` &innerTpl=`cssplay_inner` &rowTpl=`cssplay_row` &outerClass=`menu` &cssTpl=`cssplay_dropdown`]]


                  but I’ve same problem: I don’t show menu


                  my question is:

                  where (and how) Can I set the ID of the father of the menu to show??

                  1 or 2??

                  for show in menu all items the has 1 as father or 2 as father?
                    • 22427
                    • 793 Posts
                    Wayfinder builds the menus following the ressource tree. So if you want a portal page with option links to two alternative product pages, these should be child documents of the portal page in your tree. Example (with assumed document IDs 33, 34, 35):

                    __portal (33)
                    |__products1 (34)
                    |__products2 (35)

                    In the template of the portal you can use Wayfinder to create the option links:
                    [!Wayfinder? &startId=`33` &level=`1` !]

                    The parameter &level=`1` prevents the output of the children products1 and products2 in this list of options.

                    In the template for the product pages you need the following Waxfinder call:
                    [!Wayfinder? &startId=`[[UltimateParent? &topLevel=`2` ]]` !]

                    The UltimateParent snippet is looking up the tree to the upmost parent of the actual document. This would be "portal" here, so you need the parameter &topLevel=`2` to omit the "portal" in the Wayfinder output and let it start at the second level from the top, that is at products1 (or products2, respectively).

                    I hope that helps.
                    ottogal
                      • 12793
                      • 293 Posts
                      I don’t know where is it my error!!

                      I’d like to have 1 template file and not 2 template with 2 differents wayfinder and start id value


                      Now I’ve:

                      in resources:
                      home (1)
                      prod_1 (2) .... with all sub-items
                      prod_2 (3) .... with all sub-items



                      In my template now I’ve:


                      [[!Wayfinder? &startId=`[[UltimateParent? &topLevel=`1`]]` &level=`2` &outerTpl=`cssplay_outer` &innerTpl=`cssplay_inner` &rowTpl=`cssplay_row` &outerClass=`menu` &cssTpl=`cssplay_dropdown`]]


                      I’ve also tried with:

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


                      But I don’t show menu on my page sad(((

                      Where is it my error??

                      Thanks