Closed (fixed)
Project:
Date
Version:
6.x-2.4
Component:
User interface
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Sep 2009 at 17:06 UTC
Updated:
1 Sep 2012 at 16:27 UTC
Not sure if this is a support request or feature request but I was just wondering if it is possible to remove the fieldset around the date fields in my node/add forms.. just looking for a cleaner look on a particular site.
Comments
Comment #1
joachim commentedYou can probably do it with hook_form_alter in a custom module, though note that CCK fields are largely not built by that point: you should register a callback for the #after_build step.
Comment #2
progkiller commentedbut where should I remove it. It is not a separated fieldset that I can change the #access property to be disable.
Comment #3
seanbfuller commentedI was able to accomplish this using a theme override of theme_date_combo(). Place the following in your template.php file (notice I commented out the original code here):
For my purposes, I used the field_group module to group some of the time elements that I was using. I didn't want the nested fieldsets, and this seems to be doing the trick so far.
Comment #4
pfrenssenHere's how you can do it with a form alter hook in D7:
This changes the fieldset for the 'field_event_date' field to a regular div.
Comment #5
geerlingguy commented@pfrenssen / #4 - Thanks for the code—I was banging my head against a wall trying to improve the themeability of a single date field (no end date option, no all day option, etc., just a single date popup field with a label, and this was the missing link.
Comment #6
mrfelton commentedTo get my date popup field to look exactly like all other fields, I used the following:
Comment #7
hlopes commentedUsing that as-is in D7 throws a in_array warning.
Using
$form['#after_build'][] = 'MYMODULE_form_FORM_ID_hide_fieldsets';instead of
$form['#after_build'] = 'MYMODULE_form_FORM_ID_hide_fieldsets';should prevent that.
Comment #8
pfrenssenThanks, I updated my post.
Comment #9
Angry Dan commentedI've been trying to do this all day! I'm editing node_form and I only needed this line in the end:
$form['{FIELDNAME}'][LANGUAGE_NONE][0]['#theme_wrappers'] = array('form_element');Thanks!
Comment #10
dalegrebey commentedThis will remove the date fieldset from the date module. Add this to your template.php file.