Форумы / Cotonti / Skins / Colour Schemes

More information on colour schemes for themes

Twiebie
#1 06.08.2012 01:58

Themes can have different colour schemes, but how exactly does this work?

I did a search on the website here but didn't find much information on the subject.

Can someone point me in the right direction or answer the question here?

Thanks.

Oh btw - since skins are called themes nowadays with Siena, maybe it's better to change the forum category name. :)

elfrenazo
#2 06.08.2012 02:54

create category, then go to / modules / pages / tpl

example: page.list.tpl

create games category: page.list.juegos

personalize your .tpl

---------------------------------------------------------------

another option --> change themes

http://www.cotonti.com/extensions/mobile-geolocation/mobiswitcher-plugin

to the topic name in the configuration, up to three

----------------------------------------------------------------

I hope that helps

 

Twiebie
#3 06.08.2012 03:06

Thanks for the reply, but it's actually not what i'm looking for.

The first bit you explained is for customizing a TPL for different pages or categories, and the second is a plugin to specify a theme for a specific device.

I'm wondering how exactly different colour schemes can be used on themes.
Cotonti has a config option for it, but how can it be used?

[BEGIN_COT_THEME]
Name=Nemesis
Schemes=default:Default
[END_COT_THEME]
Trustmaster
#4 06.08.2012 04:55

Given that you have 3 files in themes/your_theme/css folder: default.css, light.css and dark.css, you can use them as color schemes:

[BEGIN_COT_THEME]
Name=YourTheme
Schemes=default:Default,light:Light,dark:Dark
[END_COT_THEME]

So you use CSS file names as keys and give them some titles, all comma separated.

May the Source be with you!
Kingsley
#5 06.08.2012 07:06

^^ Call me a noob, but I am a person that uses multiple css files (coz I truly do not like large css files. like to keep it organized..)

Usually I end up with a smal list:

  • default
  • index
  • pages
  • header
  • footer
  • forums and
  • users

You probably are going to tell me that a) having 1 less css files makes shit react faster, and b) whatever resaon.. :)

will this work with how I like to work?

Trustmaster
#6 06.08.2012 17:44

That's pretty fine, you can use a structure like that plus create a few stylesheets which override some colors, so you can add 'light.css' and 'dark.css' to that family and define some colors/backgrounds there (with !important override if necessary). Also don't forget about @import statement.

May the Source be with you!
Hodges
#7 27.03.2013 10:58

Hi Trustmaster,

I cannot seem to get this to work. I've created, say, green.css, blue.css and placed alongside default.css in /themes/MY_SKIN/css/. I've also added those css files to MY_SKIN.php:

<?PHP
/* ====================
[BEGIN_COT_THEME]
Name=MY_SKIN
Schemes=default:Default,blue:Blue,green:Green,monochrome:Monochrome
[END_COT_THEME]
==================== */

defined('COT_CODE') or die('Wrong URL');

?>

Upon selecting it in my profile no change occurs. 'blue.css' does not appear in the header in the source. Is there a magical tag missing somewhere to get this included?

The MY_SKIN.rc.php file seems to have 'default.css' hard-coded. Should there be a line such as:

cot_rc_add_file($cfg['themes_dir'].'/'.$usr['theme'].'/css/'.$usr['scheme'].'.css');

Cheers,
Hodges

Trustmaster
#8 27.03.2013 14:33

Most likely you will need loading 2 CSS files at a time. Move all your common CSS rules to a file called e.g. css/base.css and connect it via MY_SKIN.rc.php:

cot_rc_add_file($cfg['themes_dir'].'/'.$usr['theme'].'/css/base.css');

Then put all colour-specific styles to appropriate files like css/blue.css, css/green.css, etc. and connect them the old way in header.tpl:

{HEADER_HEAD}
<link rel="stylesheet" type="text/css" href="{PHP.cfg.themes_dir}/{PHP.theme}/css/{PHP.scheme}.css">

There's a more tricky way using cot_rc_link_file() in MY_SKIN.php, but the above should just work.

May the Source be with you!
Hodges
#9 27.03.2013 15:29

Works a treat.

Is there nothing this man cannot solve?! :)