We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5070
    • 36 Posts
    I have a documents tree with 3 levels:
    -L1
    -L2
    -L2
    -L3
    -L3
    +L1
    1. At L2 i display the L1 menu with Ditto as following code:
    [[Ditto?&parents=[*parent*]
    2.At L3 if want to display the L1 menu, i have to get id of grandfather of current document. fortunately getField snippet comes and is responsible for getting L1 id like this :
    [!GetField?&field=`id` &parent=`1` &parentlevel=`2`!]
    now, I combine 2 above technologies together :
    [[Ditto?&parents=[!GetField?&field=`id` &parent=`1` &parentlevel=`2`!]]]
    but ditto seems not recognize the id value returned from getField snippet.
    give your suggestions!

      • 4172
      • 5,888 Posts
      try
      [[Ditto?&parents=`[!GetField?&field=`id` &parent=`1` &parentlevel=`2`!]`]]

      or
      [!Ditto?&parents=`[[GetField?&field=`id` &parent=`1` &parentlevel=`2`]]`!]


      you can also use the UltimateParent-snippet instaed of GetField and why not wayFinder for the menu?

      Bruno
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 5070
        • 36 Posts
        I have tried both of 2 above solutions but nothing has been changed.
        I also tried with UltimateParent-snippet and Wayfinder but may be I’m unlucky man lipsrsealed
        snippets didn’t render the value derived from UltimateParent and getField snippet.
        help me sad
          • 20413
          • 2,877 Posts
          Just for testing I know this is taking away the function but try put &docid=`1` I think that has to be there
          and was the reason why Ultimateparent was better. But my memory...  
            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • 7231
            • 4,205 Posts
            now, I combine 2 above technologies together :
            [[Ditto?&parents=[!GetField?&field=`id` &parent=`1` &parentlevel=`2`!]]]
            but ditto seems not recognize the id value returned from getField snippet.
            Notice that you are missing the backticks surrounding the GetField snippet. Otherwise it should work.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don't know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 5070
              • 36 Posts
              I have put backticks surround the GetField snippet but it still doesn’t work.
              more specific like this:
              stand alone : [!GetField?&field=`id` &parent=`1` &parentlevel=`2`!] return value : 65
              [[Ditto?&parents=65]] it works well
              but when they were combined together, they didn’t work.
              [[Ditto?&parents=[!GetField?&field=`id` &parent=`1` &parentlevel=`2`!]]]
              I Think Ditto and Wayfinder didn’t recognize the number 65 which was returned from Getfield and UltimateParent snippets.
              any suggestions?