[solved] Changin colour of event day in Calendar

General project discussion. NOT for help questions.
Post Reply
evoke28
Forum Members
Forum Members
Posts: 28
Joined: Thu Oct 18, 2007 10:11 pm

[solved] Changin colour of event day in Calendar

Post 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
Last edited by evoke28 on Fri Feb 08, 2008 8:23 pm, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: Changin colour of event day in Calendar

Post 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
Last edited by Nullig on Thu Feb 07, 2008 12:53 am, edited 1 time in total.
evoke28
Forum Members
Forum Members
Posts: 28
Joined: Thu Oct 18, 2007 10:11 pm

Re: Changin colour of event day in Calendar

Post 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
Last edited by evoke28 on Thu Feb 07, 2008 8:41 pm, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: Changin colour of event day in Calendar

Post 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
evoke28
Forum Members
Forum Members
Posts: 28
Joined: Thu Oct 18, 2007 10:11 pm

Re: Changin colour of event day in Calendar

Post by evoke28 »

That did the trick thans a million
Post Reply

Return to “General Discussion”