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.

if latest entry

August 13, 2011 1:27pm

Subscribe [2]
  • #1 / Aug 13, 2011 1:27pm

    Cosly.com

    8 posts

    I’m looking for an if statement on the latest entry.

    On the home page we show 3 latest entries, where the first entry will show complete story and older entries show intro text with a read more link.

    I tried to solve this with two tag pairs where the first one has limit=“1” and the second has limit=“2” and offset=“1”

    But this doesn’t look great in my template 😊

    What i’m looking for is a simple {if latest_entry}{full_bodytext}{if:else}{intro_text}{/if}

    Any ideas?

  • #2 / Aug 13, 2011 2:39pm

    glenndavisgroup

    436 posts

    Would something like this work:

    {exp:channel:entries channel="news" limit="3" orderby="date" sort="desc"}
    {if count == 1}
        {full_bodytext}
    {if:else}
        {intro_text} 
    {/if}
    {/exp:channel:entries}

    Mike

  • #3 / Aug 14, 2011 5:41am

    Cosly.com

    8 posts

    Hello Mike,

    This sure works! Thanks to this piece of code I can keep my template nice and clean.

    Thanks Mike

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

ExpressionEngine News!

#eecms, #events, #releases