Closed (won't fix)
Project:
Date
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2007 at 12:41 UTC
Updated:
15 Jan 2011 at 12:17 UTC
When starting looking at getting Advanced Poll and date_popup working together this came up. I seems like it could be usefull to specify the subelements #title attribute, something like this:
if (module_exists('date_popup')) {
$form['settings']['start_date']['#type'] = 'date_popup';
// Specify the label of the new date field
$form['settings']['start_date']['#date_date_label'] = $form['settings']['start_date']['#title'];
unset($form['settings']['start_date']['#title']);
}
I choosed to call them #date_date_label and #date_time_label since a thought it was more descreptive then e.g #date_date_title (but that works as well).
| Comment | File | Size | Author |
|---|---|---|---|
| date_popup_label.patch | 1.52 KB | anders.fajerson |
Comments
Comment #1
karens commentedActually, in the rest of the code I'm doing all the labeling in themes, I just missed the labels in this module. In Drupal 6, all those themes become little .tpl files that will be easy for admins to alter while putting this in the $form array is something only developers can do much with.
I just committed a fix to add the themes to Date Popup and also added an option to show or not show the titles.
Comment #2
anders.fajerson commentedSo, for module developers, what is the best option to alter those labels?
Comment #3
karens commentedI ended up removing those labels, accidentally, since I was actually trying to accomplish something else. What I did with the date_select element was to add an option '#date_label_position' where you can indicate that labels should be above, within, or hidden (where 'within' means add something like --Year as the first item in the select list so you can see what is expected without taking up space with a title). I was going to do the same here, but realized I can't substitute a value like that into this field or the javascript won't work, so I stopped there and ended up with no labels.
I want the text of the label to be themeable, so if added back it needs to be theme('date_part_label_date', $element) or theme('date_part_label_time', $element). That will get it into the hands of themers, but I don't know how I can then make it available to developers.
Any ideas on how to do this and still make it possible for themers to adapt it?
Comment #4
karens commentedI don't think this still applies to the latest versions. Closing this old issue. Please create a new one if it does.