We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44877
    • 21 Posts
    Hello All,

    I am new to WayFinder but I have been working with it a bit and it has worked great for me, However I need something a little more dynamic that I'm not sure how to do.

    I have a set of 5 pages in my website and each page has another side menu, but each menu for all five resources will be slightly different

    I need wayfinder to detect what the current ID is and then display the appropriate menu

    I've tried a couple things but nothing i can get to work:

    [[!If? &subject=`[[*28]]` &then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89`]]`]]

    So I need to say if the ID is = to 28 display this menu if the ID is = to 29 display this one and so on.

    I've also tried &idIs=`28` and a couple other variations but couldn't really find anything to help me out on this Does anyone else have any ideas how to make this work? Thank you.

    All I need it to do is display the menu in a simple list form on the side. Thanks!
      • 44234
      • 219 Posts
      You can use the current page ID and display its sub-pages as a menu like this:
      [[Wayfinder? &startId=`[[*id]]`]]
        Find me on Twitter, GitHub or Google+
        • 44877
        • 21 Posts
        Quote from: davidpede at Aug 23, 2013, 10:34 AM
        You can use the current page ID and display its sub-pages as a menu like this:
        [[Wayfinder? &startId=`[[*id]]`]]


        Well I am trying to keep all the menus for these 5 resources in the same chunk, So I'm not sure that would work since each ID will have to have certain Docs excluded. Although this might have to be an alternative.
          • 44234
          • 219 Posts
          I am trying to keep all the menus for these 5 resources in the same chunk
          Not quite sure how you mean. Wayfinder should be used to dynamically generate the menu based on your site structure.

          Can you explain your setup and site structure in a bit more detail? [ed. note: davidpede last edited this post 13 years, 1 month ago.]
            Find me on Twitter, GitHub or Google+
            • 44877
            • 21 Posts
            Yes Right now I have a container set up like this

            PRODUCT SPECIFICATIONS
            • Spec1
            • Spec2
            • Spec3
            • Spec4
            • Spec5
            Products
            •product1
            •product2
            •product3
            •product4
            •product5
            •product6 and so on

            I have 5 resources that are product specifications pages. One product specification page might pertain to product 1 and product 2 but not product 3,4 and 5. However another product specification page might pertain to just product 3 and not the others. I am using the same template for all of these resources and have my wayFinder menu in a chunk within this template. I really don't want to have to create 5 different chunks or a separate template for each page.

            I am pulling my submenus from the products container

            So if someone clicks on the Specifications page for say sealants I need only the sealant products to show up out of the product folder, If someone clicks on the primer specifications I need only the primer products to show up in the submenu.

            So I need 5 different wayFinder menus within my chunk and for it to be able to detect what resource it is on to generate the appropriate menu.

            I hope this helps.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              That's not a job for Wayfinder. That's a job for a tagging TV or maybe getRelated http://rtfm.modx.com/extras/revo/getrelated
                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
                • 44234
                • 219 Posts
                Ahh I see. At first glance you could try using a TV for the exclusion list. Try:

                • Create a TV called 'productExclude' (or whatever)
                • Give your Specification Template access to the TV
                • For each spec page, add a list of docs you want to exclude from its menu, to the TV

                Your single sub-menu chunk:
                [[Wayfinder? &startId=`[[*id]]` &excludeDocs=`[[*productExclude]]`]]

                Add the chunk to your template and that should produce what you want.

                *EDIT: Sottwells suggestion would be better.
                  Find me on Twitter, GitHub or Google+
                  • 44877
                  • 21 Posts
                  Quote from: davidpede at Aug 23, 2013, 11:19 AM
                  Ahh I see. At first glance I would use a TV for the exclusion list. Try:

                  • Create a TV called 'productExclude' (or whatever)
                  • Give your Specification Template access to the TV
                  • For each spec page, add a list of docs you want to exclude from its menu, to the TV

                  Your single sub-menu chunk:
                  [[Wayfinder? &startId=`[[*id]]` &excludeDocs=`[[*productExclude]]`]]

                  Add the chunk to your template and that should produce what you want.


                  Thank you I will try that
                    • 44234
                    • 219 Posts
                    Quote from: sottwell at Aug 23, 2013, 11:13 AM
                    That's not a job for Wayfinder. That's a job for a tagging TV or maybe getRelated http://rtfm.modx.com/extras/revo/getrelated

                    This is the better solution, you will find it quicker and more flexible. Especially if the site grows over time.
                      Find me on Twitter, GitHub or Google+
                      • 44877
                      • 21 Posts
                      Hey here is what I did and it worked:

                      [[*id:is=`28`:then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89,90,95,96,98`]]`]]




                      [[*id:is=`29`:then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89,90,95,96,98,94,95,96,98,99,100`]]`]]