Page 1 of 1
[SOLVED] Different stylesheets for different pages
Posted: Wed Jan 30, 2013 8:56 pm
by chriggi
Hey everybody!
I want to have different stylesheets for different pages. I have already tried the following:
Code: Select all
{if $title eq "Home"}
{cms_stylesheet}
{else}
<link rel="stylesheet" type="text/css" href="*LINK TO ALTERNATIVE CSS FILE*" />
{/if}
Any help on this?
Thanks for reading!
Re: Different stylesheets for different pages
Posted: Thu Jan 31, 2013 1:53 pm
by chriggi
My bad I did not read the following:
http://forum.cmsmadesimple.org/viewtopi ... =8&t=14878
2) When editing page, or module templates, sometimes it isn't obvious what variables are available and how you
can use them.
For this, you need two things:
a) The {get_template_vars} smarty plugin
This smarty plugin is used in debugging and development to list all of the variables that smarty knows about
and their types. When working in any new (to you) template you should use this to see what variables are
available.
This is how it should be:
Code: Select all
{if $page_name eq "Home"}
{cms_stylesheet}
{else}
<link rel="stylesheet" type="text/css" href="*LINK TO ALTERNATIVE CSS FILE*" />
{/if}
Re: [SOLVED] Different stylesheets for different pages
Posted: Fri Feb 01, 2013 6:57 pm
by Dr.CSS
You can also use {cms_stylesheet name='diffstyle'} instead of linking to a flat file style sheet...