News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Calendar colors by theme basis

Started by codenaught, June 20, 2005, 06:27:50 PM

Previous topic - Next topic

codenaught

SMF has all of the calendar colors that are displayed on the Board Index set in Edit Features and Options->Calendar.

The problem is, what if your theme uses colors that make the calendar colors displayed globally on all themes hard to read?

The following tip is how to take a theme and make it use its own custom calendar colors rather then have it use the global ModSettings colors.
Open
ThemeName/BoardIndex.template.php

Find
<span class="titlebg" style="color: #', $modSettings['cal_holidaycolor'], ';">

Replace
<span class="holiday">

Find
<span style="color: #', $modSettings['cal_bdaycolor'], ';">

Replace
<span class="birthday">

Find
<span style="color: #', $modSettings['cal_eventcolor'], ';">

Replace
<span class="event">


Open
style.css

Add
.holiday
{
   color: #000080;
}

.event
{
   color: #078907;
}

.birthday
{
   color: #920AC4;
}


Change the hex values to whatever you want. Here they are on their default value.
Dev Consultant
Former SMF Doc Coordinator

Kirby

Or you can change them in your index template by going to the template_init function, add $modSettings in the global line, and then add this before the last curly bracket/} of the function:


$modSettings['cal_holidaycolor'] = '#newcolor';
$modSettings['cal_bdaycolor'] = '#newcolor';
$modSettings['cal_eventcolor'] = '#newcolor';

Advertisement: