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

    This might be a newbie question, but after searching all the documentation I was unable to find a solution.

    I have the following structure:

    Doc 1
    Doc 1.1
    Doc 1.2
    Doc 1.3
    Doc 2
    Doc 2.1
    Doc 2.2
    Doc 2.3

    Now, I have placed the following code inside my template’s sidebar:

    [[Wayfinder?&startId=`[*parent*]`]]

    ...so when I navigate to Doc 1.2 for instance, the sidebar displays a SubMenu linking to: Doc 1.1, Doc 1.2, Doc 1.3. No trouble here, it works fine this way.

    The problem arises when I place Wayfinder inside a chunk, and the SubMenu shows nothing, it’s empty.
    I believe the reason is that startId=`[*parent*]` is looking for the chunk’s parent, instead of the actual Document’s parent (and I don’t know who is the chunk’s parent).

    I found here: http://modxcms.com/forums/index.php/topic,18045.msg113846.html#msg113846 that we should use the AbsoluteParent or the SctionRoot Snippets to automatically set the the id for the current section parent, but I didn’t find any info about those ones.

    Please, any help will be appreciated.

    Thanks in advance.
      • 23050
      • 1,842 Posts
      Hi,
      Don’t know these snippets but you might try UltimateParent
        • 29181
        • 480 Posts
        I’m guessing it has something to do with you calling the snippet cached.

        [!Wayfinder?&startId=`[*parent*]`!]


        There should be no reason why a snippet called in a chunk should behave differently to how it behaves when placed directly in the template....afaik.

        Good luck,
        Taff
          Adrian Lawley: www.adrianlawley.com
          • 8790
          • 526 Posts
          You should look at GetField.

          May be a good way to get the parent id using another snippet inside the WF call
            Schtroumpf Grognon - Grouchy Smurf
            ---------------------------------
            Faites pas attention.. - Don't pay attention
            http://www.dzi-neo.net
            • 6726
            • 7,075 Posts
            GetField indeed works (beware to call the main snippet uncached, and the nested one cached though), but you’ll need it only if you call a field from another document than the document’s parent. If you need to get the field from the ultimate parent, then use the UltimateParent snippet but if not as Taff said, [*parent*] should work. I agree that this is a cache issue...
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 18878
              • 210 Posts
              Thank you guys for all your quick suggestions.

              The problem was indeed calling the Snippet cached.

              After I placed:

              [!Wayfinder?&startId=`[*parent*]`!]

              everything worked fine.

              Thanks!
                • 6726
                • 7,075 Posts
                Good news, thanks for keeping us up to date smiley
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id