We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    Hi, I am having some major issues with Ditto - very likely to be in my head rather than the MODx system!

    My need is to display just the pages that are listed within a designated container - lets say id=10

    So I want all the pages listed within contained id=10 to be called in and displayed on screen.

    The data that I would like to be displayed are some Template Variables i have set up [*Product_Name*] , [*Product_Description*] and [*Product_Photo_Thumb*]

    I need the Ditto call to be able to list all the products that will sit under container id=10 as they will get more and more over time.

    How can i achieve this? I am sure its pretty obvious but I cant seem to understand how to achieve this - at the moment the only ditto call i can get to work lists all the pages in my site which is not what i want...


    Many thanks
      • 14089
      • 56 Posts
      this would be your most basic call:

      [!Ditto? &parents=`10` &tpl=`blogTemplate` &display=`5`!]


      the template ’blogTemplate’ would be a Chunk with the following information:

      <h4><a class="blogTitle" href=[~[+id+]~] title="[+pagetitle+]">[+pagetitle+]</a></h4>
      [+TemplateVariableName+]
      
        for all things independent, check out http://www.indieophile.com
        • 8168
        • 1,118 Posts
        Legend! Many thanks! grin
          • 8168
          • 1,118 Posts
          One other thing here - is it possible to use Ditto to randomly call in content?

          I.e. If i have content documents with containers ID 10 and 12, and I want to randomly call in say 5 of the documents that sit underneath containers 10 and 12 could i do that?


          Thanks guys ;]
            • 36592
            • 970 Posts
              • 8168
              • 1,118 Posts
              sweet ;]

              One thing i have noticed a lot is, i have been miss-using ’ characters in MODx seems if you type in rather than copy code it does not work... odd
                • 36592
                • 970 Posts
                It’s back tick, not single quote...
                http://wiki.modxcms.com/index.php/Snippet_call_anatomy
                  • 8168
                  • 1,118 Posts
                  many many thanks!!!