Calendar Upcoming Events Template (Foreach Event Start Day)

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
Ronseal
New Member
New Member
Posts: 3
Joined: Mon Dec 08, 2008 12:40 pm

Calendar Upcoming Events Template (Foreach Event Start Day)

Post by Ronseal »

I All,
I installed CMSMS yesterday and also bolted on the calendar module and although I've been reading this forum for about two hours I can't quite find the info I'm after.

What I'd like to do is display events from the Calendar in an 'Upcoming Events' list view but have it grouped by Event Start Date.  I have days with multiple events so the 'Event Start Day' is the most important divider for me. Then after that, and appearing on one line, I'd like to see 'Start Time' and 'Title'. (And have both Start Time and Title as a link)

For example:











Sorry to ask so much when I've only just joined, however although I've copied the 'sample' template from the calendar's 'upcoming templates' and tried some tweeking, I just can't get my head around it.  I don't know a great deal about php or css, but I am trying my best to learn.

Cheers
Ron
Last edited by Ronseal on Mon Dec 15, 2008 12:51 pm, edited 1 time in total.
Ronseal
New Member
New Member
Posts: 3
Joined: Mon Dec 08, 2008 12:40 pm

Re: Calendar Upcoming Events Template (Foreach Event Start Day)

Post by Ronseal »

Come on Guys and Girls, has nobody any ideas of how this can be done?
I've attached the 'Calendar/List Templates/Sample' code to show you my dialema.   ;)

Cheers
Ron
{if $compact_view neq 1}
{$lang.prev}     {$lang.next}

{if $day > 0}{$day} {/if}{$month_names[$month]} {$year}
{/if}
{foreach from=$events key=key item=event}

{$event.event_title}

{assign var=month_number value=$event.event_date_start|date_format:"%m"}
{assign var=end_month_number value=$event.event_date_end|date_format:"%m"}
{if $event.event_date_start == $event.event_date_end || $event.event_date_end == 0}
{$lang.date}: {$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y"}
{else}
{if $event.event_date_start|date_format:"%d%m%Y" == $event.event_date_end|date_format:"%d%m%Y"}
{$lang.date}: {$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%H:%M"}
{else}
{$lang.date}: {$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%d"} {$month_names[$end_month_number]} {$event.event_date_end|date_format:"%Y %H:%M"}
{/if}
{/if}
{if $event.event_summary !="" && ($detail != 1 || ($event.event_details =="" ||  $event.event_details == "
"))}
{$lang.summary}: {$event.event_summary}
{/if}
{if $detail == 1}
{if $event.event_details !="" && $event.event_details != "
"}
{$lang.details}: {$event.event_details}
{/if}
{else}
{$moretext}
{/if}


{/foreach}

{if $return_url != ""}
{$return_url}
{/if}
Last edited by Ronseal on Mon Dec 15, 2008 12:52 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Calendar Upcoming Events Template (Foreach Event Start Day)

Post by Dr.CSS »

You need to find what call produces the parts you are looking for...

In the template you are using put a number before or after the calls/parts that have some kind of action, like...


{if $day > 0}{$day}1 {/if}{$month_names[$month]}2 {$year}3
{/if}
{foreach from=$events key=key item=event}
 
  {$event.event_title}4

{$lang.date}: 5{$event.event_date_start|date_format:"%e"} 6{$month_names[$month_number]}7 {$event.event_date_start|date_format:"%Y"}8

This way you will know what call does what and even if it gets used then you can take those parts and build the template you need...
Post Reply

Return to “Layout and Design (CSS & HTML)”