Put Month Name In CalGuys Calendar
Posted: Mon Jan 20, 2014 9:05 pm
How does one set up the calendar module to display the month name?
Thanks.
Thanks.
Content management as it is meant to be
https://forum.cmsmadesimple.org/
Code: Select all
{$event.event_date_start|date_format:"%B"}
Code: Select all
{strip}
<table class="calendar" id="cal-calendar">
{$event.event_date_start|date_format:"%B"}
<caption class="calendar-month">
<span class="calendar-prev"><a href="{$navigation.prev}">«</a></span>
<span class="calendar-next"><a href="{$navigation.next}">»</a></span>
</caption>
<tbody><tr>
{foreach from=$day_names item=day key=key}
<th abbr="{$day}">{$day_short_names[$key]}</th>
{/foreach}</tr>
<tr>
{* initial empty days *}
{if $first_of_month_weekday_number > 0}
<td colspan="{$first_of_month_weekday_number}"> </td>
{/if}
{* iterate over the days of this month *}
{assign var=weekday value=$first_of_month_weekday_number}
{foreach from=$days item=day key=key}
{if $weekday == 7}
{assign var=weekday value=0}
</tr>
<tr>
{/if}
<td {if isset($day.class)}class="{$day.class}"{/if}>
{if isset($day.events.0)}<a href="{$day.ni_url}">{$key}</a>{* by default use the non inline (replace content tag) version of the URL *}
<ul>
{foreach from=$day.events item=event}
<li><a href="{$event.url}">{$event.event_title}</a></li>
{/foreach}
</ul>
{else}{$key}{/if}
</td>
{math assign=weekday equation="x + 1" x=$weekday}
{/foreach}
{* remaining empty days *}
{if $weekday != 7}
<td colspan="{math equation="7-x" x=$weekday}"> </td>
{/if}
</tr>
</tbody></table>
{/strip}
That comes from:KitchM wrote: While I am probably using it incorrectly, I did find the correct placement for the month name on the page, right above the calendar and to the left
Code: Select all
{$month_names[$month]}
Code: Select all
<caption class="calendar-month"><span class="calendar-prev"><a href="{$navigation.prev}">«</a></span> {$month_names[$month]} {$year} <span class="calendar-next"><a href="{$navigation.next}">»</a></span></caption>