We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6010
    • 6 Posts
    Hallo Modx Community,

    as described in the topic i would like to show each document found by the ditto with its own template. The own template is the one defined in the resource editor for "Uses Template".

    Is this actually possbile? huh

    regards,
    cronix
      • 6010
      • 6 Posts
      Am I the only one with this need?

      I came up with one solution but its not work like it should:

      1. Add a Template Variable ’Layout’ to the Documents found by ditto.
      2. Add the Layout for each Document to the TV:
      <div class="article">
      <a name="[+alias+]"></a>
      <hr>
      [+content+]
      </div>

      3. Call Ditto like this:
      [!Ditto? &parents=`[*id*]` &tpl=`@CODE[+Layout+]` !]


      Problem: Ditto is not parsing the placeholders.

      Is there anything that I’m missing?

      kthxbye

        • 7455
        • 2,204 Posts
        ditto wil never pars this its not in the ditto template itsin the call

        ditto loops tru the documents while populating the template not before.

        Get resources in revo has a option that you can set a different template for eacht item (tpl_{n} Name of a chunk serving as resource template for the nth resource)

        ditto has no option like that
        is has however a first last and odd and even template tat makes 4 differnd templates.
          follow me on twitter: @dimmy01