Hi,
I am trying to change site's css styles comparing which page are loaded.
Is there a smarty for choosing what stylesheet are used? For example if statement to head-section? I'd like to use only one template
{if $page_alias eq "home"}
{cms_stylesheet= SOMENTHIN}
{elseif $page_alias eq "gallery"}
{cms_stylesheet= SOMENTHIN}
{/if}
Thank you
Recon
Use if-statement to choose stylesheet [SOLVED]
Use if-statement to choose stylesheet [SOLVED]
Last edited by Recon on Sat Feb 12, 2011 6:19 pm, edited 1 time in total.
Re: Use if-statement to choose stylesheet
sure, that is possible....
Just dont attach the stylesheets to the template, and call them conditionally as you described.
Ronny
Just dont attach the stylesheets to the template, and call them conditionally as you described.
Ronny
Re: Use if-statement to choose stylesheet
Hi Ronny,
I removed all attached stylesheet and try to call only one stylesheet named stylesheet like this : {cms_stylesheet= "stylesheet"} it gives me an error:
string(137) "Smarty error: [in tpl_head:44 line 5]: syntax error: unrecognized tag: cms_stylesheet= "stylesheet" (Smarty_Compiler.class.php, line 446)" string(110) "Smarty error: [in tpl_head:44 line 5]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
-R
I removed all attached stylesheet and try to call only one stylesheet named stylesheet like this : {cms_stylesheet= "stylesheet"} it gives me an error:
string(137) "Smarty error: [in tpl_head:44 line 5]: syntax error: unrecognized tag: cms_stylesheet= "stylesheet" (Smarty_Compiler.class.php, line 446)" string(110) "Smarty error: [in tpl_head:44 line 5]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
-R
Re: Use if-statement to choose stylesheet
Read the Help of the tag to see how to call them...
Re: Use if-statement to choose stylesheet
Oh... there was help... I'm still learning
And for other noobs: It was like this:
{cms_stylesheet name='stylesheet'}

And for other noobs: It was like this:
{cms_stylesheet name='stylesheet'}