We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9878
    • 31 Posts
    Hi guys,

    Probably a very simple question, but I haven’t found a clue yet, I’m sure you have ideas how to solve this.
    I use Ditto2 to create a newsSite, where 10 news are showing up (with author, date and content).
    My Ditto-Call is:
    [[Ditto?&startID=`26`&language=`german`&tpl=`NewsItem` &total=`10`]]
    

    My Chunk is:
    <div>
    <b>[+longtitle+]</b><br />
    [+date+]<br />
    [+content+]
    </div><p />


    But I want to have one entry in white, the other in blue (<div style=’background-color:#e6edf6; padding:0.6em’>).

    I thought about using the [+current+] count of Ditto and scripting it, so that if modulo 2 of [+current+] == 0 it is blue, else white
    - but that does not seem to be working in Ditto2 anymore ([+current+] does not give any number)

    Do you have any ideas to solve this? I am sure wink
    Thank you a lot!.

    Steffen
      www.steffen-uhlmann.de
      • 7231
      • 4,205 Posts
      Use the built in tplAlt feature:
      tplAlt
      Purpose

      User defined chunk to format every other document

      http://ditto.modxcms.com/files/snippet-ditto-php.html
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 9878
        • 31 Posts
        will try that, thanks a lot
          www.steffen-uhlmann.de