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.

Detecting and styling only the latest comment

April 07, 2011 1:46am

Subscribe [1]
  • #1 / Apr 07, 2011 1:46am

    Dave Crooks

    9 posts

    Hey there, I basically want to add specific CSS to only the newest comment on an entry. I’m not sure how to detect if it is the newest comment though.

    With the entries tag I would use 2 loops, the first with a limit=1, and the second with an offset. But comments don’t have this functionality correct?

    If you have any ideas on how I can accomplish this please let me know.

    Thank you

    D

  • #2 / Apr 07, 2011 2:04am

    Cheif

    626 posts

    I believe you can use the {count} tag here!

    http://ellislab.com/expressionengine/user-guide/modules/comment/entries.html#var_count

    {if count==1}
    Style me different 'casue I'm special
    {if:else}
    Style me normally because I'm not special
    {/if}
  • #3 / Apr 07, 2011 2:13am

    Dave Crooks

    9 posts

    Oh man! so easy!

    thank you! worked perfect! More Exclamations!!!!

  • #4 / Apr 07, 2011 4:55pm

    Brandon Jones

    5500 posts

    Awesome, Dave. And thank you, Cheif!  😊

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

ExpressionEngine News!

#eecms, #events, #releases