CGCalendar Group Calendar List by Day
Posted: Wed Oct 07, 2015 8:13 pm
Hi,
I have CMS 1.11.4, and CGCalendar 1.10.4. I am trying to set-up an upcoming list template for an large event. I would like to group the events by day of the week. I am able to set-up the template so the day of the week shows up for each event, but how can I set-up the template so that, for instance, all the "Tuesday" events show up under a "Tuesday" header?
The template I started is below. Thank you for any assistance. I tried moving the Day of the Week to before the {foreach} statement with no luck, and wrapping the template in an additional {foreach} statement, but was unsuccessful there as well.
<div id="events">
{if isset($pastitems) && $pastitems == 0}
{foreach from=$events key=key item=event}
<!--Day of the week Code-->
{if $event.event_date_start|date_format:"%m" == $event.event_date_end|date_format:"%m" || $event.event_date_end == 0}
<h1>{$event.event_date_start|date_format:"%A"}</h1>
{/if}
<!--Event Code-->
<div>
<div>
<p>{$event.event_title}</p>
<p>{if $event.event_details !=""}{$event.event_details}{/if} </p>
.....etc
</div>
</div>
{/foreach}
{/if}
</div>
I have CMS 1.11.4, and CGCalendar 1.10.4. I am trying to set-up an upcoming list template for an large event. I would like to group the events by day of the week. I am able to set-up the template so the day of the week shows up for each event, but how can I set-up the template so that, for instance, all the "Tuesday" events show up under a "Tuesday" header?
The template I started is below. Thank you for any assistance. I tried moving the Day of the Week to before the {foreach} statement with no luck, and wrapping the template in an additional {foreach} statement, but was unsuccessful there as well.
<div id="events">
{if isset($pastitems) && $pastitems == 0}
{foreach from=$events key=key item=event}
<!--Day of the week Code-->
{if $event.event_date_start|date_format:"%m" == $event.event_date_end|date_format:"%m" || $event.event_date_end == 0}
<h1>{$event.event_date_start|date_format:"%A"}</h1>
{/if}
<!--Event Code-->
<div>
<div>
<p>{$event.event_title}</p>
<p>{if $event.event_details !=""}{$event.event_details}{/if} </p>
.....etc
</div>
</div>
{/foreach}
{/if}
</div>