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
Pages: [1]   Go Down
Print
Author Topic: Color coding different events  (Read 579 times)
0 Members and 1 Guest are viewing this topic.
rgreene
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: July 25, 2005, 11:46:00 AM »

I am looking at this program for use on a cub scout web page and we might have two events on the same day but one might be an hosted by our pack and another hosted by our council
example ..
8/14 - 2:00 - 4:00 Pack Bike Ride
8/14 - 2:00 - 5:30 Cub Scout day at the Ball Park

Is it possible for the "Pack Bike Ride" to display in Blue text and the "Ball Park" be in a different color. That way we can easily differentiate between Pack and Council activities?

Thanks, and from what I've see I really like the program. Excellent job guys!!

Rick

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: July 25, 2005, 12:30:00 PM »

** Is it possible for the "Pack Bike Ride" to display in Blue text and the "Ball Park" be in a different color. **

Just about anything's possible. See if the message titled "Color coding Events" in the 'Links' section of the Unofficial CalendarScript - Mods and Plugins site has information you can use to achieve that result.

Dan O.

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

Logged
rgreene
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: July 25, 2005, 03:00:00 PM »

Thanks DanO,

I'm completely new to this but I'll give it a shot. All I have to do is copy the code that TubaDave has has posted in the templates/calendars/default/default.htm correct? I assume that I can change the catagory listings he has in his code ie. {category} eq "cultural")
{category} eq "political")
{category} eq "social")

to
{category} eq "pack")
{category} eq "council")

and delete the remaining elseif lines. When I go to add an event then will there be a spot where I choose pack or council or is that something else I have to add? Like I said I'm completely green when it comes to this stuff. It took me a full day just to get the demo loaded and working because I was trying to make it harder than it was.

Thanks for your help on this I really do appreciate it!!!

Rick

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

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: July 25, 2005, 09:25:00 PM »

** I assume that I can change the catagory listings he has in his code ie. {category} eq "cultural")  **

First you will need to set up an event field named "category". Without it there will be nothing to do the comparison against.

** and delete the remaining elseif lines. **

You can delete any number of elseif lines you won't be using.

**  When I go to add an event then will there be a spot where I choose pack or council or is that something else I have to add? **

Not until you customize the event database to add the field. Any changes you make is the default.html template fill only affect the displaying of information. Altering the event database is done through the administration section.

** Like I said I'm completely green when it comes to this stuff. **

Than you've got some learning to do.

    TIP: Keep a backup copy of all original files just in case.

Dan O.

[This message has been edited by DanO (edited July 25, 2005).]

Logged
rgreene
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: July 26, 2005, 07:33:00 AM »

I added the Category  and I made it a Select Box. Under the "Display Text" area I typed in Pack clicked add and it moved it over to the Current Options area. I then typed in Council and add and it was moved over to the Current Options area. I clicked Save and it told it was saved. I then went to Add Event and my category shows up and it is a select box and Pack is an option but Council is not listed. When I go back and edit the category on Pack is listed under Current Options. What am I doing wrong? Is this correct in order to reach my ultimate goal?

Thanks,

Rick

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

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: July 26, 2005, 12:31:00 PM »

** When I go back and edit the category on Pack is listed under Current Options. **

** What am I doing wrong? **

I don't know but make sure you enter a title AND a value for each option you add.

 PS. Whatever you enter for the option values need to be the *exact same* (even case wise) as to what you use in the conditional in the template edit.

Dan O.

[This message has been edited by DanO (edited July 26, 2005).]

Logged
rgreene
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #6 on: July 26, 2005, 01:04:00 PM »

Sorry for showing my stupidity DanO,

I wasn't entering a value so I bet that will do it but what should my value be?

If I follow these directions and add the following code to the default.html page what should I put in for a value?


Find <!-- GRID STYLE DISPLAY -->, then look down for the line that displays the title:

<A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" CLASS="gridtext"><%= EVENT FIELD(title) %></A><BR>

Replace that with:

<%
if ($EVENT->{details}->{category} eq "pack") {$color="#00FFFF";}
elsif ($EVENT->{details}->{category} eq "council") {$color="#0000FF";}
%>

<A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" CLASS="gridtext"><FONT COLOR="<%=$color%>"><%= EVENT FIELD(title) %></FONT></A><BR>

You might also want to move that block of if's and elseif's up a few lines just after <%FOREACH EVENT%> so you can use <FONT COLOR="<%=$color%>"> around the time as well.
olor%>"> around the time as well.

THANKS AGAIN!!!!

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

I added the event field Category with the Unique ID of category. I made it a submenu
and I have the display text field as pack with the option value as pack and I have a Display text field of council and option value of council.

When I add an event I have the choice of pack or council so that part is working correctly. but when I view the calendar in the date I put my event it shows the code. This is what was showing under July 27th on the month view

if ($EVENT->{details}->{category} eq "pack") {$color="#00FFFF";}
elsif ($EVENT->{details}->{category} eq "council") {$color="#0000FF";}
• 10:00 am -11:00 am : <

Sorry for being a pain!!

Rick

[This message has been edited by rgreene (edited July 26, 2005).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #7 on: July 26, 2005, 04:14:00 PM »

**  what should I put in for a value? **

Whatever you're going to be using on the conditional or vise versa.    

quote:
This is what was showing under July 27th on the month view

if ($EVENT->{details}->{category} eq "pack") {$color="#00FFFF";}
elsif ($EVENT->{details}->{category} eq "council") {$color="#0000FF";}
• 10:00 am -11:00 am : <


It shouldn't be. You're sure you have the new lines (if... elsif...) surrounded by <% ... %> tags???

Can you post a link to the calendar so we can see it for outselves?

Dan O.

[This message has been edited by DanO (edited July 26, 2005).]

Logged
rgreene
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #8 on: July 27, 2005, 06:55:00 AM »

Again thank you for your assistance in this. I know you're getting tired of hearing from me and again I appologize for my ignorance. No the if elseif lines were not in the <% %>. So I enclosed them and now I get an Error Processing Template. I have it up on a site to just play with and evaluate and that site is http://www.lacrgreene.com/calendar/calendar.pl

** what should I put in for a value? **

Whatever you're going to be using on the conditional or vise versa.  

Does that mean pack and council (in my case)?

Thanks,

Rick

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #9 on: July 27, 2005, 11:53:00 AM »

** No the if elseif lines were not in the <% %>.  **

It is important you do any modifications *exactly* as described.

BTW. Each line doesn't need to be enclosed separately, both can be enclosed in a single set of <% %> tags as was shown in the original modification suggestion and also in the excerpt of it that you posted above.

This is what is in your template:    

quote:

<%if ($EVENT-& gt;{details}-& gt;{category} eq "pack") {$color="#00FFFF";} %> <br>
<%elsif ($EVENT-& gt;{details}-& gt;{category} eq "council") {$color="#0000FF";} %>

That's not quite the code that was suggested. I assume you used an HTML editor to edit the template and it is changing > symbols to the HTML entity & gt; (a space is added so it will display here).

You must use a 'text editor' (Notepad, Textpad, etc.) to edit the templates and NOT any kind of WYSIWYG HTML editor or a word processor like Word?, etc.

** Does that mean pack and council (in my case)? **

Yes.

Dan O.

[This message has been edited by DanO (edited July 27, 2005).]

Logged
rgreene
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #10 on: July 27, 2005, 01:32:00 PM »

THANK YOU!! THANK YOU!!! THANK YOU!!!!

You did it. It's working. The event name has a different color depending on the category. I tried moving the if else statements up to be directly under the <%FOREACH EVENT%> heading but I time isn't changing color. It's not that big of a deal.

I really do appreciate all that you have done to help me out

Rick

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #11 on: July 28, 2005, 11:54:00 AM »

** It's working. **

Glad to hear it.

Dan O.

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

Logged
Pages: [1]   Go Up
Print
Jump to: