We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10395
    • 96 Posts
    Sorry in advance if the wayfinder call is not exactly correct, I don’t have access to the exact call I made.

    I created a simple snippet to retrieve the current doc ID. I want to put it in WayFinder as the startID.

    I have the following Wayfinder call:

    [[Wayfinder ?startid=`[[CurrentDoc]]`]]

    However, it doesn’t output as intended (all the children links under the current doc).

    When I do the following:

    [[CurrentDoc]]

    [[Wayfinder ?startid=`[[CurrentDoc]]`]]

    It does work, which is strange. It outputs the correct current doc ID, and also wayfinder outputs as intended.

    Is there something specific causing the snippet to be listed twice in order for the included snippet call to work correctly?

    Thanks
      • 26931
      • 2,314 Posts
      Hi Gaia,
      try calling your snippets
      [[Wayfinder ?startid=`[!CurrentDoc!]`]]
      or
      [!Wayfinder ?startid=`[[CurrentDoc]]`!]


      ...and why not [[Wayfinder ?startid=`[*id*]`]] ?

      j
        • 22303 MODX Staff
        • 10,725 Posts
        As a note, this behavior is unique to Evolution releases; nested snippet calls work fine in Revolution releases (all tags processed in true source order).

        Quote from: Gaia at Feb 16, 2010, 04:53 PM

        When I do the following:

        [[CurrentDoc]]

        [[Wayfinder ?startid=`[[CurrentDoc]]`]]

        It does work, which is strange. It outputs the correct current doc ID, and also wayfinder outputs as intended.

        Is there something specific causing the snippet to be listed twice in order for the included snippet call to work correctly?
        Yes: order of execution. In this case you are evaluating CurrentDoc before Wayfinder, and when it is processed, it replaces all instances of the tag. Otherwise, the nested call is ignored because of the nature of the regular expressions Evolution uses to parse it’s tags.
          • 10395
          • 96 Posts
          Thanks for the explanation OpenGeek smiley.

          Using [!Wayfinder ?startid=`[*id*]`!] worked like a charm, thanks sharkbait!