Hi,

i installed the calendar module and it works just fine.
I've got a view that shows events (which are nodes of type event_general and event_training in my case) for a whole month in a calendar view...

My problem is that both event types (event_general and event_training) look the same way.
Is it possible to change the style by type (event_general background stays yellow, while event_training background becomes green)

Best regards,
Niko

Comments

Niko_K’s picture

Hi,

i guess that i found a solution.
The way to get this to work is the following:

1) Modify the calendar-month-node.tpl.php in the modules/calendar/theme directory to use the node-type as css class (i added the class to the second div... so calendar monthview is now calendar monthview event-<?php print $node->type; ?>
2) Edit the calendar.css file in modules/calendar. I added my node types at the end of the file. For example:

.calendar-calendar td .inner div.event-training div,
.calendar-calendar td .inner div.event-training div a {
  background: #fcc;
}

Nodes with the type "training" are shown with a light-red background color after these chanegs.
However, there are still 2 problems:
*) The changes to the calendar.css file are done in the modules/calendar directory (and not in the theme directory). This is NOT a very good idea, since updates to the calendar module will destroy the changes to the event styles
*) This only works with the month view (it should be easy to change this also for day and year view, now that i know what has to be done)

I think the first issue has to be solved before the second one can be addressed.
Is there a way to move the calendar.css file to the theme/mytheme/ directory? Just copying the file to this directory (and clearing views cache, which worked for the calendar-month-node.tpl.php file) didn't work for the calendar.css file. A possible solution would be changing f.e. style.css in the theme/mytheme/ directory, but in fact this is not what i want (the calendar style should be one it's own)

Any suggestions?
Niko

haggins’s picture

subscribing

esadev’s picture

Hi,
is it a way to colorize some days (without any node linked) like Saturday/Sunday with an other style ? I talk about all views, bloks included.
If yes, could I do same in a dates range (from-to values loaded from an external table for example).

Thx

ytokan’s picture

With D6 and Calendar 2.1 you can chose color for content type, taxonomie categori or taxonomy terms.
Go in views, calendar_date
then go in page view and go in the "Calendar settings" you find here :
Legend Content Types: Edit
Legend Vocabularies: Edit
Legend Terms: Edit
Date changer: No
Add new date link: Date

By
Yto

wallythornton’s picture

is it possible to do the same thing for the calendar block view? by default a calendar event is simply underlined... differentiating between different types would be helpful in this view too - perhaps more-so.

Anonymous’s picture

Ytokan....but that only adds a coloured line above the entry on the day in the calendar.

How can you take this a step further and style the background of that entry (which is one specific content type represented on the calendar), the colour of the text of that entry etc?

Is this possible easily and successfully? Could this be added as a feature as it seems Niko_K has done some research towards this already?