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.

show only 2 upcoming entries (aka events)

April 30, 2010 2:49pm

Subscribe [2]
  • #1 / Apr 30, 2010 2:49pm

    theVitalPath

    23 posts

    hi,

    i have a weblog called “events”...i need to show only the next 2 upcoming events regardless of date as long as the date is on or after today.

    i have the following, but this is displaying all the future entries:

    {exp:weblog:entries weblog="events" status="open" dynamic="off" show_future_entries="yes" show_expired="no" orderby="date" sort="asc"}
    {if entry_date > current_time}
    <li class="feb"><a href="http://whats-happening/">{entry_date format="%F %d, %Y"}</a></li>
    <li class="workshop"><a href="http://whats-happening/">{title}</a>{event_short_description}</li>
    {/if}
    {/exp:weblog:entries}

    any suggestions?

    thanks!
    Dan

  • #2 / Apr 30, 2010 2:53pm

    Gareth Davies

    491 posts

    Use the start_on parameter then limit to 2. There’s a good explanation in the docs:

    http://expressionengine.com/docs/modules/weblog/parameters.html#par_start_on

  • #3 / Apr 30, 2010 2:57pm

    theVitalPath

    23 posts

    ha, this is why i love EE and its community…that took what, less than 1 minute for an answer?!

    thanks Gareth!
    Dan

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

ExpressionEngine News!

#eecms, #events, #releases