ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Highlight newest entry in non-chronological list

December 15, 2009 5:56pm

Subscribe [2]
  • #1 / Dec 15, 2009 5:56pm

    martin.mckenna

    1 posts

    Hi all,

    On my review site I list entries by rating. This makes it difficult to spot which entries are new since the visitor’s last visit. I’d like to insert a “NEW!” badge beside the newest entry in the list (or, say, every entry made in the last week—I post two per week). The list is at http://www.lunchblock.ie/index.php/site/list/

    I’ve tried searching the docs but I’m unsure how to go about this. The easiest way I can imagine would be something along the lines of

    {if newest="true"}new-badge.png{/if}

    or something like being able to compare the entry date with the current date, and if the difference is less than 1 week, show the badge.

    Any ideas? Thanks!

  • #2 / Dec 15, 2009 6:07pm

    Mark Bowen

    12637 posts

    Hi Martin,

    Two ways immediately spring to mind on this one, the It’s New plugin and the easier way of if you order your posts by date then you can always just use :

    {if count == "1"}
    Place image code here…
    {/if}

    Hope that helps a bit.

    Best wishes,

    Mark

  • #3 / Dec 15, 2009 6:51pm

    martin.mckenna

    1 posts

    Fantastic Mark, that’s exactly what I was looking for. Thanks again.

  • #4 / Dec 15, 2009 7:05pm

    Mark Bowen

    12637 posts

    No problem at all. Glad that helped.

    Best wishes,

    Mark

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases