Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to have a calendar which has stlyes for every blank day, as opposed to what is supported by current Drupal HEAD. It should look something like:
I see that it would only be possible if we make the blank days themeable. It would be possible to make the whole calendar themeable, but that would open up a lot more stuff, since then the calendar code would need to be abstracted out from the archive table assembler code.
BTW this is a Hungarian Drupal setup, with monday being the first day, and the calendar is for 2005 January.
Comment | File | Size | Author |
---|---|---|---|
#5 | Drupal-allow-individual-blank-day-styles.patch | 2.88 KB | Gábor Hojtsy |
#1 | Drupal.allow.themeing.blank.days.patch | 1.28 KB | Gábor Hojtsy |
drupalcal.png | 16.16 KB | Gábor Hojtsy |
Comments
Comment #1
Gábor HojtsyHere is a proposed patch, which simply makes the blank days themeable, so that I can use
str_repeat("<td class=\"day-blank\"> </td>\n", $blankdays)
in my theme.Comment #2
Gábor HojtsyWhat is this patch is waiting for? :)
Comment #3
Steven CreditAttribution: Steven commentedI'm leaning towards making the whole calendar themable rather than just the blank days. It seems a bit too shallow. Another thing to consider is to simply output the blank days as individual cells, and use CSS to hide their border in the default themes (it uses border-collapse: collapse; so I think it wouldn't require special handling of the first/last blank cell).
Comment #4
Gábor HojtsyGood to get input on this :) Either way is fine with me, but making the whole calendar themeable is a lot more work in the code, since now logic and display are very much intermixed in the calendar code. It would be nice, if the CSS solution would work.
Comment #5
Gábor HojtsyAs Steven suggested, here is a version, which always prints out individual table cells for blank days, so it is possible to style them differently in CSS, but retains the well-known calendar format with dropping the borders on the blank days, and falling back on border-collapsing (this is why the table border needs to be introduced).
Also included in this patch are some simple CSS optimizations to use 0 instead of 0em and 0px.
Comment #6
Dries CreditAttribution: Dries commentedCommitted to HEAD.
Comment #7
(not verified) CreditAttribution: commented