Project:Calendar
Version:6.x-2.2
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I'd like to cutomize the Year view which is quite unusable for me: the default display only hightlights the days with associated nodes as links, which is quite invisible and poorly informative.

How can I get the linked node information in the year view, somehting close to - or exactly - what appears in the month view ? I know this will expand the size of the cells, but I would limit the information to short references (the calendar is used to display a training schedule)

I suppose I should modify the calendar-year.tpl.php file, make it looking like the month view including generatin the 2 additional files in the year context, but I am not php and Drupal programming skilled enough to do that.

I would appreciate some help.

thanks in advance.

Comments

#1

I would love to be able to do the same exact thing! companies seem to always want multiple months on one page. Putting one month on each row can allow showing more in each cell. I would appreciate some help with it but will post again if I find a solution.

#2

I was looking for something similar and came up with the following. Not a full solution, but an improvement.

-Background
I made a booking page where people could book a cabin. There is also the possibility to add some important dates. These two different contents shows up in the year calendar view. Unfortunately one can not see if it is a "booking" or an "important date".
It would also be preferred if you could see who had made the booking, but I realized that would be to much work. (which would have been a solution the problems mentioned in posts above)

-Solution
To differ the both I edited calendar.inc
After this code on line 130

        (empty($items[$curday_date]) ? ' has-no-events' : ' has-events');

I added
        if(!empty($items[$curday_date])) {
            // echo "<pre>".var_dump($items[$curday_date])."</pre>";
            foreach($items[$curday_date] as $dayItem) {
                // echo "<pre>".var_dump($dayItem)."</pre>";
                if(!empty($dayItem)) {
                    foreach( $dayItem as $unknownIndex) {
                        $class .= "-".$unknownIndex->raw->node_type;
                    }
                }
            }
        }

that will add the node-type to the css-code like this
has-events-NODETYPE

Then I just add .has-events-NODETYPE to an appropriate .css-file and specifies for example
.has-events-booking {
  background-color: #f00;
}

Be aware of multiple types on the same day!
I know there is a redundant if, but I wanted to mess with the code as little as possible.
The $unknownIndex is unknown for me, but someone else might explain how it's constructed???
I left the commented lines which I used for debugging/development

-Conclusion
Not a perfect solution (pretty ugly one might say), but it works for me.
/Magnus

nobody click here