Fix cripled theme_calendar_date_box()

JohnAlbin - April 6, 2008 - 08:08
Project:Calendar
Version:5.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:JohnAlbin
Status:closed
Description

calendar_build_day() builds the theme for each day in the calendar. And it calls theme_calendar_date_box() to get the themed box containing the day part of the date.

Unfortunately, it has a major limitation from a themers vantage point. The only thing it knows about that day is the boolean $selected, which says whether or not that day contains nodes. This is a pretty silly limitation since calendar_build_day() has access to the full list of the $items in the view.

If we extend the call to theme_calendar_date_box() to pass the view’s $items, it opens up tons of options for the themer. They can theme based on taxonomy of the nodes, for example. Or, if there is only 1 item for a date, the date_box’s URL could be changed to go straight to that node. In fact, they could theme based on anything that is placed in the view’s fields, like themeing based on the node’s author. It makes me drool to think of the limitless possibilities.

I hope I’ve talked up why this feature request should get into Calendar 5.x-2.x. Especially since the patch is so very simple.

Please, please, please consider this for inclusion before 5.x-2.0 is released. :-D

AttachmentSize
calendar-date-box.patch1.66 KB

#1

JohnAlbin - April 6, 2008 - 12:18
Priority:critical» normal

Ok. Maybe calling it a “critical” feature request is an abuse of that status. ;-)

#2

noahb - April 8, 2008 - 10:43

patch applies cleanly, but I haven't had a chance to test it yet.

As John said, +1 for inclusion in the release...

#3

KarenS - April 29, 2008 - 15:43
Status:patch (code needs review)» fixed

Good idea, sorry it took so long to get done. Committed to 5.2 and HEAD.

#4

JohnAlbin - April 29, 2008 - 16:15

Sorry it took so long to get done.

No problem. We're all just volunteers!

Thanks for including this feature request; I know my fellow themers will appreciate it!

#5

Anonymous (not verified) - May 13, 2008 - 16:22
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.