Page 1 of 1

[solved] Changin colour of event day in Calendar

Posted: Wed Feb 06, 2008 10:47 pm
by evoke28
I was just wondering if anyone knew how to change the background colour of an event day in calendar. At the moment the number only has a colour of a hyperlink  and is very hard to distinguish from the others. If all the event day had a different colour then it would be easier to that it was an event.

If it is not in this version on calendar i think it would be cool to have it in the next version.Just easier to notice that there is an event on the calendar.

here is my site if anyone wants to see the calendar.

thanks
evoke

Re: Changin colour of event day in Calendar

Posted: Thu Feb 07, 2008 12:51 am
by Nullig
If you're using the calendar stylesheet:

#big .event { background-color: #FFB6C1;}

and the template:

Code: Select all

<td {if isset($day.class)}class="{$day.class}"{/if} 
{if isset($day.events.0)} 
{foreach from=$day.events item=event}
    class="event"
{/foreach}
{/if}>
Nullig

Re: Changin colour of event day in Calendar

Posted: Thu Feb 07, 2008 8:39 pm
by evoke28
Thanks for the reply.Tried what you said but after that only half the site came up. not sure why. Here is my original calendar template code.

Code: Select all

{strip}
<table class="calendar" id="{$table_id}">
{if $compact_view neq 1}
<caption class="calendar-month"><span class="calendar-prev"><a href="{$navigation.prev}">«</a></span> {$month_names[$month]} {$year} <span class="calendar-next"><a href="{$navigation.next}">»</a></span></caption>
{/if}
<tbody><tr>
{foreach from=$day_names item=day key=key}
<th abbr="{$day}">{$day_short_names[$key]}</th>
{/foreach}</tr>

<tr>
{* initial empty days *}
{if $first_of_month_weekday_number > 0}
<td colspan="{$first_of_month_weekday_number}"> </td>
{/if}

{* iterate over the days of this month *}
{assign var=weekday value=$first_of_month_weekday_number}
{foreach from=$days item=day key=key}
{if $weekday == 7}
	{assign var=weekday value=0}
</tr>
<tr>
{/if}

//Below is what you want to change completely[/size]

<td {if isset($day.class)}class="{$day.class}"{/if}>
{if isset($day.events.0)}<a href="{$day.url}">{$key}</a>
{if $summaries == true}
<ul>
{foreach from=$day.events item=event}
<li><a href="{$event.url}">{$event.event_title}</a></li>
{/foreach}
</ul>
{/if}


//to as far as here

{else}{$key}{/if}
</td>
{math assign=weekday equation="x + 1" x=$weekday}
{/foreach}

{* remaining empty days *}
{if $weekday != 7}
<td colspan="{math equation="7-x" x=$weekday}"> </td>
{/if}


</tr>
</tbody></table>

{/strip}


Can you see a problem of why it would not work. I am running  cms 1.1.4 taga.
Not sure what other information to tell you.

thanks
evoke

Re: Changin colour of event day in Calendar

Posted: Thu Feb 07, 2008 10:11 pm
by Nullig
Change:

Code: Select all

<td {if isset($day.class)}class="{$day.class}"{/if}>
to:

Code: Select all

<td {if isset($day.class)}class="{$day.class}"{/if} 
{if isset($day.events.0)} 
{foreach from=$day.events item=event}
    class="event"
{/foreach}
{/if}>
Nullig

Re: Changin colour of event day in Calendar

Posted: Fri Feb 08, 2008 1:44 pm
by evoke28
That did the trick thans a million