All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Listing previous/run-up events

Michael 28 Feb 2014 19:46 question, complete

For a given event, I want to display the five directly previous events — *not* relative to the current date, but relative to the given event. Is this possible using native tags?

Replies

  1. Low 1 Mar 2014 10:17

    It might be possible using an embed. Pass through the start date and entry ID of the given event, and use that as the date="" and entry_id="" param (using entry_id="not {embed:entry_id}" to exclude the given event). So it might require some fiddling.

  2. Michael 1 Mar 2014 15:27

    That's what I'm doing currently... but then all events on the same day as my given event are also displayed, whether or not they occur before or after the given event.

  3. Low 2 Mar 2014 10:23

    So, what if you add this to the given event (single event):

    {embed="events/prev" date="{event_dates:start_date}" entry_id="{entry_id}"}


    ...where {event_dates:start_date} is the start date of the given event. Then the events/prev template could contain this:

    {exp:low_events:entries 
    unit="passed"
    date="{embed:date}"
    entry_id="not {embed:entry_id}"
    limit="4"
    sort="desc"
    } ... {/exp:low_events:entries}


    Does that help?

  4. Michael 5 Mar 2014 20:39

    Ah ha!

    unit="passed" is the ticket. Not sure how I missed that in the docs.

    Thanks!