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

Support archive

Returning entries that contain the current month

Luke David 21 Jan 2015 17:57 question, complete

We are using a Low Event custom field to store birthdays and anniversaries. How can I return all entries that contain the current month that matches that which is stored in a Low Events custom field. I wish to have the database only return those entires in which match the current month so that i don't unnecessarily query data that I don't need.

Replies

  1. Low 21 Jan 2015 18:11

    LE itself doesn't have tags/params for this yet, but the Query module can help you out:

    {exp:query sql="SELECT GROUP_CONCAT(entry_id SEPARATOR '|') AS entry_ids FROM exp_low_events WHERE MONTH(start_date) = '{current_time format='%m'}'"} 
    {exp:channel:entries entry_id="{entry_ids}" orderby="event_dates" sort="asc"}
    {title}: {event_dates:start_date}
    {/exp:channel:entries}
    {/exp:query}


    ...where 'event_dates' is your events field.