We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15510
    • 70 Posts
    I have a structure like this:

    Document A (container)
    Document B (container)
    Document B1
    Document B2
    Document C (container)
    Document C1
    Document C2

    Documents B and C use Ditto to wrap up their children into a single document. I am trying to use a Ditto call in Document A to combine its children (B and C) but the call never returns the contents of B1, etc. Are there issues with nested Ditto calls or am I just doing something wrong?

    Thanks.
      • 5340
      • 1,624 Posts
      What is the ditto call?
        • 15510
        • 70 Posts
        [!Ditto? &depth=`1` &display=`all` &tpl=`slide` &sortBy=`menuindex` &sortDir=`ASC` &debug=`0` !]

        This call is present in A, B, and C.

        The Ditto call shows up as content for B and C. I actually see "[!Ditto?..." rendered on the page.
          • 5340
          • 1,624 Posts
          try [[ ]] instead of [! !]

          set &depth=`2`

          I’m not sure what you what to display and where but we can work on it

          are you using it in a menu or for a document listing?
            • 15510
            • 70 Posts
            Thanks for the reply.

            Actually the application is a MODx implementation of S5 (http://meyerweb.com/eric/tools/s5/). Document A is a complete slideshow (like a seminar), Documents B and C are topical sections, and Documents B1, B2, etc. are the slides. I want to be able to build the seminar presentation from the various topical sections depending on the need.

            Thanks,
            kc64
              • 15510
              • 70 Posts
              Those two things did not work. I get an Internal Server Error.

              Is it allowable to nest Ditto?
                • 36592
                • 970 Posts
                How about adding &parents=`Bid,Cid` to the Ditto call on document A, where Bid and Cid are the document id of document B and C.
                  • 15510
                  • 70 Posts
                  OK, thanks to all of your suggestions, I am making much progress. Thank you xpix and tkfm.

                  I have made Document A just a container with no logic.

                  I have made another document elsewhere in the tree (arbitrary placement) which will be the compiled slideshow. It will draw from the topical sections by document ID. I upgraded to Ditto 2.1 because it claims to be able to sort by multiple items using &sortBy. I haven’t found any usable documentation on this feature.

                  The Ditto call now is:
                  [!Ditto? &parents=`[*tvlist*]` &sortBy=`menuindex` &sortDir=`ASC` &depth=`1` &tpl=`slide` &display=`all` &debug=`1` !] 


                  This collects all of the slides I want by the parent IDs I place in my new TV, but unfortunately it interdigitizes them (section1slide1, section2slide1, section3slide1, section1slide2...) since each section has an ordinal in menuindex that specifies its position. I would really like to sort by [parent, menuindex] but when I set &sortBy=`parent, menuindex` or &sortBy=`parent menuindex`, I get no desirable result.
                    • 15510
                    • 70 Posts
                    A refinement to my previous post.

                    Given that tvlist contains "167, 143", and that menuindex is set for each parent doc, I actually want the slides to appear in this order:

                    All children of 167 in sort order of menuindex, all children of 143 in sort order of menuindex. If I rearrange the TV, the slides should reorder to match.

                    Thanks
                      • 15510
                      • 70 Posts
                      ganeshXL--

                      Thanks for the post.

                      I guess I would like to know how to do what you suggest, "do one Ditto call per container, and pass these values to the main Ditto call". I’m fairly inexperienced and have only done single Ditto calls thus my original post topic about doing nested Ditto calls. I somehow can’t make it work.

                      Thanks,
                      kc64