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

    I’m kinda new to modx and I really start to love the possibilities of this great codework.
    But now i run into some problem with Ditto:

    I want to display the latest X news on an page with this ditto call:

    [[Ditto? &tpl=`splashnewsteaser` &startID=`77` &summarize=`7` &archiveDateType=`pub_date` &dateFormat=`%d %b '%y` &truncText=`weiterlesen...` &paginate=`1`]]
    

    Live: http://www.splash-festival.com/splash_news.html

    The template code:
    <div class="splashnewsteaser">
    <div class="newsdatum"> 
    <span class="tag">[*createdon:date=`%d`*]</span><br/>
    <span class="monat">[*createdon:date=`%b`*] '[*createdon:date=`%y`*]</span>
    </div>
    <h3 class="newsheadline"><a href="[~[+id+]~]">[+longtitle+]</a></h3>
    <p>[+summary+] [+link+]</p>
    <em> [+date+]</em>
    </div>
    


    The problem is that i want to style the date as seen on top right in the example so i have to split it to style the specific parts.
    But unfortunately all shown dates are the same.
    Below the summary of the post the correct date is displayed for testing reason by calling the PH [+date+].

    On the full article page the date is split and styled the right way.
    See: http://www.splash-festival.com/neue-splash-website-online.html

    Can you guys help me to have the date on the listing shown the right way?

    Big thanks in advance!
      • 10575
      • 5 Posts
      Found the answer in this thread: http://modxcms.com/forums/index.php/topic,36910.0.html

      Ditto call goes something like this:
      [[Ditto? &orderBy=`pub_date DESC` &dateSource=`pub_date` &tpl=`date_ditto` &extenders=`summary` &display=`5` ]]


      Format the date directly in the date_ditto chunk something like this:

      <p class="date fancy2">[+pub_date:date=`%b`+]</p>
      <p class="date fancy2">[+pub_date:date=`%d`+]</p>
      <p class="date fancy2">[+pub_date:date=`%Y`+]</p>