Page 1 of 1
Calendar Display a full year
Posted: Mon Oct 30, 2006 10:26 am
by steve136
Hello
I'm using Calendar 0.7.4, what I would like to do is show a full year on a single page instead of a single month.
Is this possible?
I would guess I need to alter the sql in function.displaycalendar, before I starting messing with it (and probably break it) can anyone give me a bit of help and point me in the right direction?
Re: Calendar Display a full year
Posted: Mon Oct 30, 2006 12:47 pm
by Greg
In the admin section - Go to Modules - on the Calendar Module line click the help link.
The tag you need to insert on your page is:
{cms_module module='Calendar' display='yearlist'}.
Re: Calendar Display a full year
Posted: Mon Oct 30, 2006 4:02 pm
by steve136
Thanks for the quick reply.
Am I correct in thinking this displays a list of the event for each year?
What I'm trying to do is have the month table show,but show one years worth on one page (see image)
Sorry I cant explain it better, sorry for asking dumbass questions, I've just started using this CMS so I'm just getting to grips with it.
[gelöscht durch Administrator]
Re: Calendar Display a full year
Posted: Tue Oct 31, 2006 2:07 am
by Greg
You are correct. The yearlist and other lists are just that lists.
Your explaination with the graphic makes your request very clear.
Don't know of a way to do this with the current version. Looks like a geat idea, add it to the feature request area.
Also note - no question is considered a dumbass question on this forum.

Re: Calendar Display a full year
Posted: Tue Oct 31, 2006 6:14 am
by Dr.CSS
You could put 12 calendar calls in the page, one for each month...
{cms_module module="Calendar" table_id="big" display="calendar" month="1"}
{cms_module module="Calendar" table_id="big" display="calendar" month="2"}
{cms_module module="Calendar" table_id="big" display="calendar" month="3"}
etc....
I would put six in one div six in another and float one right something like this...
http://www.multiintech.com/index.php/calendar.html
Re: Calendar Display a full year
Posted: Tue Oct 31, 2006 8:08 am
by steve136
Thanks for your replies.
Mark your suggestion is perfect, I've set up a page for each year, just need to remove some of the unneeded html(prev-next links and I'm set.
I'm always cautious when posting on a forum, in case I'm asking the impossible or the questions already been answered or you can already do what I'm asking, but I've missed the setting.
Guess I've been hanging around other forums too long!!
Re: Calendar Display a full year
Posted: Fri Jul 13, 2007 11:16 am
by Zoorlat
Great, found what I was looking for here.
I wanted to list the current month and the two following. Starting from Mark's example and being aided by som smarty variables:
{cms_module module="Calendar" display="list" compact_view='0' detail='0' month=$customcontent_monthnum}
{cms_module module="Calendar" display="list" compact_view='0' detail='0' month=$customcontent_monthnum+1}
{cms_module module="Calendar" display="list" compact_view='0' detail='0' month=$customcontent_monthnum+2}
I post this in case anyone else is trying to achieve the same thing.
Ciao!
Re: Calendar Display a full year
Posted: Fri Jul 13, 2007 11:34 am
by RonnyK
Zoorlat,
good to have it more flexible. I was thinking about a similar solution, as I wanted to have a rolling calendar instead of the fixed year, but still have a question with this. How does it handle if the current month = 11 or 12, does the smarty get away with it, skipping to the first month of the next year???
Ronny
Re: Calendar Display a full year
Posted: Fri Jul 13, 2007 2:40 pm
by Zoorlat
RonnyK :
No, I think you are right. My solution was a bit too quick. A bit more logic is needed. As well we need the year-attribute. Something like this perhaps:
Code: Select all
{cms_module module="Calendar" display="list" compact_view='0' detail='0' month=$customcontent_monthnum year=$customcontent_4digityear}
{if $customcontent_monthnum+1 gt 12}
{cms_module module="Calendar" display="list" compact_view='0' detail='0' month=$customcontent_monthnum+1-12 year=$customcontent_4digityear+1}
{else}
{cms_module module="Calendar" display="list" compact_view='0' detail='0' month=$customcontent_monthnum+1 year=$customcontent_4digityear}
{/if}
{if $customcontent_monthnum+2 gt 12}
{cms_module module="Calendar" display="list" compact_view='0' detail='0' month=$customcontent_monthnum+2-12 year=$customcontent_4digityear+1}
{else}
{cms_module module="Calendar" display="list" compact_view='0' detail='0' month=$customcontent_monthnum+2 year=$customcontent_4digityear}
{/if}
etc...
I am sure there is a more clever way to solve this, but this should work (I think...)

(Anyone know if Smarty knows while-loops?)