We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31729
    • 10 Posts
    hi!
    I’d like to using Ditto to display a list of documents in three columns.
    The snippet is

    <div class="container">
    [[Ditto? &parents=`40` &depth=`1` &tpl=`category`]]
    </div>

    The tpl "category" is
    <div class="x">
    (some additional html)
    </div>

    But each column must have a different style (like in attach).

    How can I do this?

    (sorry for my English)
      • 3707
      • 241 Posts
      One method would be to use 3 Ditto calls in 3 columns, use the display parameter to limit the results for each column and use the start parameter to offset the results for the second and third columns.
      <div id="col1">
      [[Ditto? &parents=`40` &depth=`1` &display=`4`  &tpl=`category`]]
      </div>

      <div id="col2">
      [[Ditto? &parents=`40` &depth=`1` &display=`4`  &start=`4`  &tpl=`category`]]
      </div>

      <div id="col3">
      [[Ditto? &parents=`40` &depth=`1` &display=`4`  &start=`8`  &tpl=`category`]]
      </div>

      You can then use the id of each column to style the contents individually.

      Otherwise, you’ll have to use an iteration method:
      http://modxcms.com/forums/index.php/topic,15018.0.html
      http://modxcms.com/forums/index.php/topic,14478.msg97548.html