We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27302
    • 154 Posts
    Thanks. Good to know Wayfinder might be an option if I can’t get this to work.

    My Debug report is attached.

    The StartID is being reported as [!UltimateParent

    Should this be the case, or should it show the ID that Ultimate Parent should be fetching?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Looks like the RTE replaced the & with & . Try editing the page without the RTE and get rid of the & bits.
        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
        • 27302
        • 154 Posts
        I just replaced the RTE with & and it hasn’t made any difference.

        Ultimate Parent on its own (outside of a Ditto call) is returning the correct parent ID I require. Judging from the Ditto debug report it looks as if Ditto might not be recognising the Ultimate Parent call properly.
          • 7231
          • 4,205 Posts
          Yes, I just noticed the debug console available (I was not aware that this would be available to the public when active, should only be for managers). Strange that the UltimaParent is getting cut rather than parsed. It is obvious that this is causing the problem and my guess is that the parsing order is to blame.

          OK I did some tests and I was able to get the same problem when using the outside snippet cached and the inside one uncached like this:
          [[Ditto? &parents=`[!UltimateParent? &topLevel=`1`!]` &tpl=`test` &display=`all` &debug=`1`]]

          By reversing it it worked:
          [!Ditto? &parents=`[[UltimateParent? &topLevel=`1`]]` &tpl=`test` &display=`all` &debug=`1`!]

          I also noticed that you get slightly different results when using &parents and &startId.
            [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]
            • 27302
            • 154 Posts
            This is quite strange. I just tried your suggestion by using
            [!Ditto? &parents=`[[UltimateParent? &topLevel=`3`]]` &depth=`1` &tpl=`DittoSubCats` &sortBy=`id` &sortDir=`asc` &paginate=`0` &summarize=`4` &filter=`hidemenu,0` &debug=`1`!]
            


            But I get this result
            http://www.coolactiv.com/test.html
              • 7231
              • 4,205 Posts
              I see it, the good news is that it is filling int he correct parent ID grin

              [!Ditto? &parents=`2` &depth=`1` &tpl=`DittoSubCats` &sortBy=`id` &sortDir=`asc` &paginate=`0` &summarize=`4` &filter=`hidemenu,0` &debug=`1`!]


              Is this being called from within another snippet or a TV?
                [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]
                • 10449
                • 956 Posts
                In your HTML, you have this somewhere:

                <-- You are here!

                use &lt;-- instead

                Maybe this confuses the parser.

                  • 27302
                  • 154 Posts
                  Yes, it is good that it is calling the correct parent ID.

                  The actual call is being made from within a Chunk. Although I have also tried placing the call directly from within a template with the same result.


                  In your HTML, you have this somewhere:

                  <-- You are here!

                  use &lt;-- instead

                  Maybe this confuses the parser.

                  Thanks, I’ll give this a go smiley
                    • 27302
                    • 154 Posts

                    use &lt;-- instead

                    Okay, just tried that. Still no luck.
                      • 27302
                      • 154 Posts

                      Is this being called from within another snippet or a TV?

                      For some more clarification, I have a TV in the template, and then a set of Chunks for Level 1, Level 2 etc (so instead of having a seperate template for Level 1 documents, Level 2 documents etc I can use a single template and just tick which level the document is with a TV to get that document to show an extra menu etc).

                      Test.html has the Level 4 Chunk selected which contains the Ditto call (actually Test.html is a Level 5 document in reality. But I do not actually need another Chunk for Level 5 because of the way the site works. For example Level 1 and Level 2 documents can both use the Level 1 chunk)