How does one set up the calendar module to display the month name?
Thanks.
Put Month Name In CalGuys Calendar
Re: Put Month Name In CalGuys Calendar
On does not setup the module to do that. You need to alter the template(s) to do it for you.
Example:
Will print the month name. If the web server is configured properly it will print a localized month name.
Format: http://www.php.net/manual/en/function.strftime.php
Example:
Code: Select all
{$event.event_date_start|date_format:"%B"}
Format: http://www.php.net/manual/en/function.strftime.php
Re: Put Month Name In CalGuys Calendar
Thanks. That makes sense.
However, there isn't a template for the calendar, so I can't figure out where to put the code.
However, there isn't a template for the calendar, so I can't figure out where to put the code.
Re: Put Month Name In CalGuys Calendar
Of course there are templates!
Note the 'Templates' link with a scissors icon in front of it (again a little less intuitive).
Note the 'Templates' link with a scissors icon in front of it (again a little less intuitive).
Re: Put Month Name In CalGuys Calendar
Well, I'll be..... It was right there in the module's own area. Top right corner.
Why aren't they with the section called Templates?
Is there a default one? How does a user know?
Thanks for your help.
Why aren't they with the section called Templates?
Is there a default one? How does a user know?
Thanks for your help.
Re: Put Month Name In CalGuys Calendar
Module templates are always with the module itself. User doesn't need to know. Only you, and now you know 

Re: Put Month Name In CalGuys Calendar
You are all correct. The modules each have their own templates. Except for the weird scissors icon, the convention is followed from the rest of CMSMS.
The basic and currently default template is entitled "sample".
I tried to edit and use the code from velden, but it did nothing.
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.
What am I doing wrong? Here's the code:
The basic and currently default template is entitled "sample".
I tried to edit and use the code from velden, but it did nothing.
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.
What am I doing wrong? Here's the code:
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}
Re: Put Month Name In CalGuys Calendar
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]}
Make your community a better place!
Re: Put Month Name In CalGuys Calendar
The default template shows what is needed:
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>
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo
--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--