CGcalendar: No Name of Month Displayed

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
rovercar
New Member
New Member
Posts: 9
Joined: Wed Jun 24, 2009 6:36 am

CGcalendar: No Name of Month Displayed

Post by rovercar »

All I have is << >> with no month named. Shows the correct calendar for the present month but does not indicate something like <<March 2014>>

Otherwise, calendar fully functional.

I could really use some help on this one, please.
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: CGcalendar: No Name of Month Displayed

Post by staartmees »

do you use a standard template out of the box?
All CG-modules need php 5.3.x.
cmsms version?
chandra

Re: CGcalendar: No Name of Month Displayed

Post by chandra »

Which language do you are using?
fiddler

Re: CGcalendar: No Name of Month Displayed

Post by fiddler »

I, too, had problems with the CGCalendar not displaying the name of the month and I looked to the forum here yesterday for a solution, but found none after an exhaustive 2.5 hour search.

This morning I decided to compare the templates of the CGCalendar on my brand new site, with a CGCalendar on a site I had upgraded. The main calendar templates were DIFFERENT!

This is what is missing:
{$month_names[$month]}&nbsp;{$year}&nbsp;

The entire code - as it appears in my upgraded site before calling up the first row of the table is:

<table class="calendar" id="cal-calendar">
<caption class="calendar-month">
<span class="calendar-prev"><a href="{$navigation.prev}">&laquo;</a></span>&nbsp;{$month_names[$month]}&nbsp;{$year}
&nbsp;<span class="calendar-next"><a href="{$navigation.next}">&raquo;</a></span>
</caption>

Once I added the missing code, the name of the month now shows. Hope someone finds this useful.
rtrainer
New Member
New Member
Posts: 2
Joined: Tue May 06, 2014 5:27 pm

Re: CGcalendar: No Name of Month Displayed

Post by rtrainer »

fiddler wrote: This is what is missing:
{$month_names[$month]}&nbsp;{$year}&nbsp;
What file should I put this in?
fiddler

Re: CGcalendar: No Name of Month Displayed

Post by fiddler »

Open up your CG Calendar program in the CMS admin panel.
Over on the right, next to an image of a pair of scissors you'll see the link "Templates". The Calendar Templates tab has a Sample as default. Bring up that template (if that is the template you use as your main template) and add code on the 3rd/4th line accordingly.
rtrainer
New Member
New Member
Posts: 2
Joined: Tue May 06, 2014 5:27 pm

Re: CGcalendar: No Name of Month Displayed

Post by rtrainer »

Thank you, worked like a champ.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12678
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: CGcalendar: No Name of Month Displayed

Post by Dr.CSS »

Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image
ivobaska
New Member
New Member
Posts: 9
Joined: Thu Jul 26, 2007 7:59 pm

Re: CGcalendar: No Name of Month Displayed

Post by ivobaska »

No this item cannot be closed yet as all these calendar templates seem to have this problem.
On my site "september" is not shown where it should be and "october" is shown as "november". And "november" is displayed where it indeed should be "november".
The solution given in this thread looks simple but for those who are not into programming like me it is not so obvious.

Quote from the module's changelog:
<p>The 1.14.x series stops using the hardcoded month and day names in the lang file and began using locale specified date names. If you are encountering an 'off by one' problem in the CGCalendar display templates you will want to fix up your frontend templates. Restoring frontend templates to factory defaults should solve the issue. Essentially, you should not use the {$month_names} or {$day_names} array (they are one based). And instead should use the {$event.event_date_start} and {$event.event_date_end} smarty variables, and the date_format modifier to format dates appropriately.</p>

To me this is not clear.
Can the author of this module give the right templates?

Thanks for a great module.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3304
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: CGcalendar: No Name of Month Displayed

Post by velden »

Actually it's all in that quote:

Use the system's locale to get month names: have a look at http://php.net/manual/en/function.strftime.php
%B is probably what you're looking for.

The developer gives you the right templates: 'Restoring frontend templates to factory defaults should solve the issue'
Create a new temporary template and look how it's done in there.
Post Reply

Return to “Modules/Add-Ons”