Make a Lasting Impression
ImpressCMS Blog > Different theme styles for different modules

Different theme styles for different modules

You have a nice theme for your ImpressCMS site, but what of you would like use different styles for each site section, as news, downloads, wiki, etc. There are themes with different colors; why uses only one color if you can use all availables? Here if Smarty tag shows its power. Let´s go!

Imagine the theme have four colors in different CSS files. They are: default.css, blue.css, orange.css, black.css and your start page use news module.


Edit the theme.html file and look for CSS files. Now change the code according this example:

!-- Sheet Css -->

<{if $icms_dirname == "news"}>

<link rel="stylesheet" type="text/css" media="all" href="<{$icms_imageurl}>default.css" />

<{elseif $icms_dirname == "simplywiki"}>

<link rel="stylesheet" type="text/css" media="all" href="

<{$icms_imageurl}>blue.css" />

<{elseif $icms_dirname == "downloads"}>

<link rel="stylesheet" type="text/css" media="all" href="<{$icms_imageurl}>orange.css" />

<{else}>

<link rel="stylesheet" type="text/css" media="all" href="<{$icms_imageurl}>black.css" />

<{/if}>

All posts by debianus
Subscribe to latest posts
The comments are owned by the poster. We aren't responsible for their content.
Poster Thread
skenow
Posted: 2015/3/19 2:46  Updated: 2015/3/19 2:46
Home away from home
Joined: 2007/12/4
From:
Posts: 4236
 Re: Different theme styles for different modules
Thanks for all the design tips, @debianus!

Something I've done in the past is to add the dirname as a class (elements can be part of more than 1 class)


<body  class="<{$icms_dirname}> theme-default">


Then, you can have your stylesheet set different values based on the module, too.

You could even have different header images, based on each module, couldn't you?
debianus
Posted: 2015/3/27 11:13  Updated: 2015/3/27 11:13
Home away from home
Joined: 2007/12/4
From: Spain
Posts: 1281
 Re: Different theme styles for different modules
Quote:

You could even have different header images, based on each module, couldn't you?


Sure. Images, backgrounds, fonts type, fonts-size, etc.
Examples:
Wiki

Contact
63RD
Posted: 2015/6/11 20:01  Updated: 2015/6/11 20:01
Home away from home
Joined: 2009/3/6
From:
Posts: 254
 Re: Different theme styles for different modules
this is awesome!