I am needing to display a list of Calendar events that are selected from a Playa field. Of course, I need it to not display events that has passed (by event date) and if the events in the Playa custom field are all passed a 'No Events' message is returned.
My setup is as follows: Channel A contains the Playa custom field that is pulling in all Event entries.
My code is below:
{exp:channel:entries channel="education" disable="categories|member_data|pagination"}
<ul>
{exp:playa:children channel="calendar_events" limit="5"}
{exp:calendar:events event_id="{entry_id}" date_range_start="today" date_range_end="3 months"}
{if calendar_no_results}
No Events
{/if}
<li>{title}</li>
{/exp:calendar:events}
{/exp:playa:children}
</ul>
{/exp:channel:entries}
Doing this sort of works as it will output 'No Events' but it will do it twice as there are two entries selected in the Playa field that have passed.
If a event that hasn't passed (schedule for next month) that list will display the future event along with the 2 'No Events' for the other 2 passed events.
I've messed with Stash as well trying the calendar:events tag for the append_list and placing the get_list within channel and playa tags; see below.
{exp:calendar:events event_id="{entry_id}" date_range_start="today" date_range_end="3 months"}
{exp:stash:append_list name="cal_events"}
{stash:item_title}{title}{if calendar_no_results}No Events{/if}{/stash:item_title}
{/exp:stash:append_list}
{/exp:calendar:events}
{exp:channel:entries channel="education" disable="categories|member_data|pagination"}
<ul class="icons-ul">
{exp:playa:children channel="calendar_events"}
{exp:stash:get_list name="cal_events" limit="5"}
<li>{item_title}</li>
{/exp:stash:get_list}
</ul>
{/exp:channel:entries}
what am i missing?
thanks in advance!