We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30497
    • 245 Posts
    I am using Wayfinder for sidebar navigation for a site. There is a funtion I would like, but am not sure how to do it with Wayfinder.

    I have a couple of "index" pages within the site - "news", "articles", "teachers" etc. I have Wayfinder set up so that they display the desirable sidebar navigation. But, I want the pages within those categories to show the same sidebar menu as the parent.

    ie- "articleX", "articleY" and "articleZ" should show the same sidebar navigation as "articles"; and, "newsA", "newsB", and "newsC" should show the same sidebar navigation as "news".

    Is this possible?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Make a TV with an input type of Textarea and the default value of @INHERIT. In the parent documents, edit the TV to have the Wayfinder call you want. The children will inherit that Wayfinder call.
        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
        • 30497
        • 245 Posts
        Quote from: sottwell at Apr 13, 2008, 12:25 AM

        Make a TV with an input type of Textarea and the default value of @INHERIT. In the parent documents, edit the TV to have the Wayfinder call you want. The children will inherit that Wayfinder call.

        Ok, thanks sottwell. I guess it is time I finally read up on TVs, then. smiley

          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Yeah, I was really hesitant about them at first, now I don’t know what I would do without them! And I don’t know half as much about them as I should.
            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
            • 30497
            • 245 Posts
            Quote from: sottwell at Apr 13, 2008, 12:25 AM

            Make a TV with an input type of Textarea and the default value of @INHERIT. In the parent documents, edit the TV to have the Wayfinder call you want. The children will inherit that Wayfinder call.

            Well, I still need to look into it a bit more, but from a basic read of the documentation on TVs, I gather that the parent and child would both have to be based on the same document template for this to work, right?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Yes, that’s why they are called Template Variables.
                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
                • 30497
                • 245 Posts
                Quote from: sottwell at Apr 13, 2008, 12:25 AM

                Make a TV with an input type of Textarea and the default value of @INHERIT. In the parent documents, edit the TV to have the Wayfinder call you want. The children will inherit that Wayfinder call.

                Ok, I have done this, but the children aren’t inheriting, they are poor....

                Specifically, I made these steps:

                1. Created a new template based on the original - "templateB"
                2. created a new TV with textarea input type and the default value of @INHERIT
                3. edited "templateB" to replace my previous wayfinder call with
                [*exampletv*]

                4. updated the parent and one child document to use "templateB"
                5. in the TV for the parent, I added my Wayfinder call
                [!Wayfinder? &level=`1`!]

                6. Checked that the child has a TV with @INHERIT in the text area

                Now, from this, the parent menu in the TV is displaying, but the child is simply not inheriting. Did I make a silly error here?


                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Consider what you have done with that snippet... you’ve told Wayfinder to use the current document as the parent, by not specifying a startId, so it uses the default, right? So each page is inheriting just that: use the current document as the parent! Even when the current document is one of the children.

                  Specify the ID of the parent: [!Wayfinder? &startId=`xx` &level=`1`!]

                  And that’s the beauty and the beast of computer programming. Unlike teenaged children, computers do exactly what you tell them to do. It’s just that sometimes what you tell them to do is not quite what you meant grin
                    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
                    • 30497
                    • 245 Posts
                    Quote from: sottwell at Apr 15, 2008, 10:42 AM

                    Consider what you have done with that snippet... you’ve told Wayfinder to use the current document as the parent, by not specifying a startId, so it uses the default, right? So each page is inheriting just that: use the current document as the parent! Even when the current document is one of the children.

                    Specify the ID of the parent: [!Wayfinder? &startId=`xx` &level=`1`!]

                    And that’s the beauty and the beast of computer programming. Unlike teenaged children, computers do exactly what you tell them to do. It’s just that sometimes what you tell them to do is not quite what you meant grin

                    sottwell, you are the best, thanks a lot.

                    TVs really are quite something, I can see there is huge potential here once I get over my initial MODx learning curve.