We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16574
    • 49 Posts
    how can I retrieve only the last 2 news and how can I display them in two collumns

    here’s the ditto call

    [!Ditto? &startID=`11` &summarize=`5` &tpl=`NewsItem` &total=`2` &alwaysshow=`2` &paginate=`1` &sortBy=`createdon` &sortDir=`DESC` &trunc=`1` &truncLen=`300` &commentsChunk=`` &displayArchive=`1` &paginateAlwaysShowLinks=`1` &descendentDepth=`1` &tagDelimiter=`,` &tagData=`tvcategoryOptions` &tagMode=`onlyTags` &tags=`World,City,Bar1,Bar2`!]

    thanks
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Set the summarize to 2, order by create date, and use sortdir DESC (or ASC, dyslexic here needs to use trial and error to figure out which is which).

      Have your Ditto template include a <div> container, then position them with CSS. If you give them an appropriate size, approximately half of the main container they’ll both be in, and float them both left, they’ll line up nicely.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 18397
        • 3,250 Posts