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

Support archive

How to show Past/Future/Current events?

Yann 18 Oct 2013 23:36 question, complete

I'm trying to setup 3 different lists of events:

Current
Past
Future

I thought it was going to be a breeze but I guess I don't really "get" the event add-on. I'm using Playa too so I'm guessing the best way is to use exp:low_events:entry_ids right?

For Future events, I'm doing this and it seems to be working:

{exp:low_events:entry_ids channel="events" unit="upcoming" show_active="no"}
{exp:playa:parents parent_id="{low_events:entry_ids}"}
HTML...
{/exp:playa:parents}
{/exp:low_events:entry_ids}

For Past Events (working too):

{exp:low_events:entry_ids channel="events" unit="passed"}
{exp:playa:parents parent_id="{low_events:entry_ids}"}
HTML...
{/exp:playa:parents}
{/exp:low_events:entry_ids}

But for Current Events, I'm stuck... I though this tag returns current + upcoming by default no? This seems to break the tags and nothing gets returned:

{exp:low_events:entry_ids channel="events" show_upcoming="no"}
{exp:playa:parents parent_id="{low_events:entry_ids}"}
HTML...
{/exp:playa:parents}
{/exp:low_events:entry_ids}

I also tried a different approach, but that seems to break too and doesn't return any IDs:

{exp:low_events:entry_ids channel="events" date="now" show_upcoming="no"}

What am I missing? Thanks!!

Replies

  1. Low 19 Oct 2013 11:04

    Check out this answer which should help you along a bit, specifically the last example. Basically, for active (or current events) you can use this:

    unit="day" show_passed="no" show_upcoming="no"


    ...which says:
    - Get all events of this day (no date="" param is given, so today is assumed);
    - Omit events that have passed (have an end date/time in the past);
    - Omit events that are upcoming (have a start date/time in the future).

    Your example of date="now" show_upcoming="no" says:
    - Get all upcoming events (date param is invalid and no unit is given, so upcoming is assumed)
    - Omit events that are upcoming, so no results are found.

  2. Yann 19 Oct 2013 12:09

    Thanks for the quick reply!

    Your solution doesn't actually work for me. No IDs are returned.

    I did some more testing in the meantime and this seems to be working though:

    {exp:low_events:entry_ids channel="events" date="now;now"}

    Is there something wrong in my setup then? I did seem to have found a solution, but if this is unexpected behavior, I'd rather set it up right so I don't run into other unexpected behavior down the line... Thanks again!

  3. Low 20 Oct 2013 09:10

    It might depend on what you'd consider to be Current Events. You can always turn on Template Debugging and look at the output generated by Low Events. For the combination of parameters I suggested, what does that say?