Hi everybody!
I have a a questions concerning templates, is there a way to automatically switch between them, based on a date? To get a seasonal look, with summer/winter/easter templates?
[solved] seasonal look? automatically switching templates?
-
- New Member
- Posts: 5
- Joined: Fri Oct 22, 2010 8:22 pm
[solved] seasonal look? automatically switching templates?
Last edited by CMSMSrocks! on Sun Oct 24, 2010 10:02 pm, edited 1 time in total.
Re: seasonal look? automatically switching templates?
This post is in Dutch
But it explains how to setup the cms_stylesheet, to act with different coloring based on time. But you could set this to seasons instead...
http://forum.cmsmadesimple.org/index.ph ... #msg215895
Ronny
P.S. There is also a tutorial about the seasons, I might be able to find that, but that might be a little later if needed... Tomorrow I will leave for a small holiday...

http://forum.cmsmadesimple.org/index.ph ... #msg215895
Ronny
P.S. There is also a tutorial about the seasons, I might be able to find that, but that might be a little later if needed... Tomorrow I will leave for a small holiday...
-
- New Member
- Posts: 5
- Joined: Fri Oct 22, 2010 8:22 pm
Re: seasonal look? automatically switching templates?
I have a look!
Thanks for the extremely fast reply!
Thanks for the extremely fast reply!

-
- New Member
- Posts: 5
- Joined: Fri Oct 22, 2010 8:22 pm
Re: seasonal look? automatically switching templates?
Here what I ended up doing:
1. Create different stylesheets, e.g. xmas_css, valentine_css
2. Attach both css templates to the html Template!
3. Insert this into your html template header, replace {cms_stylesheet} with the following:
It worked perfectly for me this way. However, at first, I tried to do it directly in only ONE css template and it wouldn't work nicely because {cms_stylesheet} is cached!
Credits for this solution:
http://forum.cmsmadesimple.org/index.php?topic=43550.0
1. Create different stylesheets, e.g. xmas_css, valentine_css
2. Attach both css templates to the html Template!
3. Insert this into your html template header, replace {cms_stylesheet} with the following:
Code: Select all
{capture assign="currentmonth"}{$smarty.now|date_format:"%m"}{/capture}
{capture assign="currentday"}{$smarty.now|date_format:"%d"}{/capture}
{if $currentmonth == 12 && $currentday < 25 }
{cms_stylesheet name="xmas_css"}
{elseif ( $currentmonth == 1 && $currentday > 28 ) or ( $currentmonth == 2 && $currentday < 15 ) }
{cms_stylesheet name="valentine_css"}
{/if}
Credits for this solution:
http://forum.cmsmadesimple.org/index.php?topic=43550.0