We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8442
    • 48 Posts
    Hi there I was wondering if there was a way to add a "new" graphic to the 3 newest posts?

    Basically I am looking for a way to do this:

    http://freundevonfreunden.com/

    See half way down the page is a "new" graphic for the new items.

    Thanks in advance

      • 18389
      • 169 Posts
      Ooooh, I would like that too!
        www.markojokic.com
        • 26931
        • 2,314 Posts
        if you are using Ditto you could try something like this (in your Ditto-Template):
        [+iteration:lt=`3`:then=`<div id="newsbadge"></div>`:else=``+]
          • 18389
          • 169 Posts
          Sharkbait,

          could you go into a little more detail please?

          we would put:
          [+iteration:lt=`3`:then=`<div id="newsbadge"></div>`:else=``+]


          in the ditto-template as in &tpl=`mychunkname` from the ditto call?

          I can’t find "iteration" in the ditto parameters page: http://wiki.modxcms.com/index.php/Ditto

          Thanks,
          Marko
            www.markojokic.com
            • 18389
            • 169 Posts
            I’ll answer that one actually...

            Yes it goes in the &tpl chunk.

            There was a typo I think... what it would say is this instead:

            [+ditto_iteration:lt=`3`:then=`<div id="newsbadge"></div>`:else=``+]


            the original post was missing "ditto_"

            And it works !
              www.markojokic.com
              • 8442
              • 48 Posts
              Brilliant, thanks for your help!