Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO, Marty)Event Background Color in Day Span
Pages: [1]   Go Down
Print
Author Topic: Event Background Color in Day Span  (Read 953 times)
0 Members and 1 Guest are viewing this topic.
Lindau
New Member
*

Karma: 0
Offline Offline

Posts: 30


WWW
« on: August 12, 2007, 10:42:33 AM »

OK. I looked at "add event title allow color choice to display".

So at http://www.cert-la.com/calendar2/calendar.cgi?calendar=callout, on the default.html, I added this before %><HTML>:

sub colorize {
   my $details = shift;
   $details->{'title'} = "<font color='" . $details->{'color'} . "'>" . $details->{'title'} . "</font>";
   }

if ($VIEW eq "EVENT") {
   colorize ($EVENT->{'details'});
   }
elsif ($VIEW ne "Search") {
   foreach $EVENT (@$EVENTS) {
      colorize ($EVENT->{'details'});
      }
   }
else {
   foreach $EVENT (@$SEARCH_RESULTS) {
      colorize ($EVENT->{'details'});
      }
   }

That colors the text.

How can I keep the text black and have the background for each event be the color I asked for?
« Last Edit: August 12, 2007, 11:03:57 AM by Lindau » Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: August 12, 2007, 01:54:55 PM »

** How can I keep the text black and have the background  color [change]? *

See garyL's replies in the following forum message:

LINK > Color coding Events

The code may need to be modified somewhat or added in several places depending on the template you're using,

Dan O.
Logged
Lindau
New Member
*

Karma: 0
Offline Offline

Posts: 30


WWW
« Reply #2 on: August 12, 2007, 02:25:44 PM »

Is that in place of the "sub colorize" stuff, or in addition to it?
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: August 13, 2007, 01:55:28 AM »

You would have to alter the line:

$details->{'title'} = "<font color='" . $details->{'color'} . "'>" . $details->{'title'} . </font>";

so it is similar to (but probably not exactly like) the code shown at the link I referenced. Mainly just to replicate the parts from <span...>to </span>

JFYI

Dan O.

Logged
Lindau
New Member
*

Karma: 0
Offline Offline

Posts: 30


WWW
« Reply #4 on: August 16, 2007, 10:10:46 PM »

I give up.

I don't have time to learn Perl.
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #5 on: August 18, 2007, 02:15:47 PM »

It really has very little to do with Perl, it's an HTML 'thing'. The title would just have to be surrounded by the span tag like shown in the example I linked to. Eg.

<span style="background: Color_Variable_Here ">  Event_Title_Here </span>

JFYI

Dan O.
Logged
Lindau
New Member
*

Karma: 0
Offline Offline

Posts: 30


WWW
« Reply #6 on: August 19, 2007, 04:42:41 PM »

The example shown at http://www.cert-la.com/calendar2/calendar.cgi?calendar=call-out is not real. I edited the source code for the page and uploaded that as default.html
Logged
Pages: [1]   Go Up
Print
Jump to: