We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6792
    • 11 Posts
    I posted this question a while back in the Web Design and Dev section and was directed to Ditto as a solution. I’ve gone over the documentation and searched this forum with no success. Maybe someone here has an idea.

    I’d like to provide a "print topic" capability.

    On the site, I have multiple topics. Each topic is a container with a number of child pages. What I’d like to do is take the content from each child page in that section and place it all into one long page. (Is "concatentate" the word for this?) This would make printing each section a snap.

    Any ideas on how I would approach this?

    Thanks!


    David
      • 18397
      • 3,250 Posts
      A standard Ditto call will do. For example, if the container document had id #10 you would use the following call:

      [[Ditto?parents=`23`&tpl=`myTemplate`&display=`all`]]

      Now, the chunk myTemplate would have the following in it:
      [+content+]
      <hr />
      


      Now, you will see a horizontal rule delimited list of all of the child documents content.

      To make it dynamic, you would want to write a quick snippet that returned the preceding Ditto call (substituting the correct parent using $modx->documentObject[’parent’] ) if it was in the right folder.
        • 6792
        • 11 Posts
        Perfect! That works fine -- thanks very much.