I'm trying to theme some form elements individually by adding the #theme attribute to the element I want to theme. This works fine for textareas, selects, etc... but when theming radios or checkboxes it is the children (i.e. the options) that use the defined theme function, and not the element itself. The element itself is passed through the default theme_radios/theme_checkboxes.
I would like to be able to theme the element's title to add markup around it, however I can't do this with radios or checkboxes as the title is overridden by the default theme function, regardless of what's specified. Was this intentional?
Is there a way for me to achieve what I want using any of the #process, #after_build, etc... callbacks? Or do I have to put the #theme on the parent element and handle the theming of all the children/options myself?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | D6-form.inc_.patch | 1.37 KB | yonailo |
Comments
Comment #1
ainigma32 commentedGood question ;-)
Unfortunately I don't have the answer. Maybe you could just try some experiments and see what you can come up with?
I'm sure there are more, less skilled drupalistas looking for this info.
- Arie
Comment #2
damien tournoud commentedI don't see that behavior anywhere in the code: a #theme function applied to a "checkboxes" element should override theme_checkboxes().
Could you pastebin some code isolating the broken behavior you are seeing?
Comment #3
cdale commentedI can't seem to reproduce this problem anymore, so I'll close this issue. If I manage to make it happen again, I'll reopen with more information.
Comment #4
chewie commentedI confirm this problem at drupal 6-xx current version
when use theme_radios or drupal_render() #options didn't work
I dont found any remarks at api.drupal.org about radios rendering or theming
Comment #5
yonailoFor example:
This code does not show the radio options. Is this the expected behavior (tested avec latest D6 version) ?
Comment #6
yonailoComment #7
yonailo