[support] help extending module: content taxonomy
sebastian
inforazor at gmail.com
Sat Nov 19 09:20:42 UTC 2011
Hello,
I'm trying to solve the issue in:
http://drupal.org/node/548286
I've been using a eclipse to step through the maze, but I'm just getting
lost and confused; I end up at the theme() function with still an
un-rendered $form variable but 200+ functions to map out and at that
point my brain blanks out...
The fieldset for checkboxes clearly has a space to load 'description'
from the form elements in:
function optionwidgets_buttons_process (...)
(...)
$element[$field_key] = array(
(...)
'#description' => $element['#description'],
(...)
);
(...)
But by the time it gets to this function, the $element['description'] is
null and so nothing gets added.
In HOOK_form_alter the 'content taxonomy' field only states the default
values, not the actual loaded terms; this apparently happens later
somewhere; otherwise I could have done some surgery via this method.
I believe I basically want to hook into the process, via a theme-hook or
module-hook, and alter the output of the check boxes that are being
shown to include "description" -- which can then be displayed as hover text.
It currently outputs:
<div id="edit-field-sub-group-value-60-wrapper" class="form-item
form-option">
<label for="edit-field-sub-group-value-60" class="option">
<input type="checkbox" class="form-checkbox" value="60"
id="edit-field-sub-group-value-60" name="field_sub_group[value][60]">
Coordination
</label>
</div>
Desired output is:
<div id="edit-field-sub-group-value-60-wrapper" class="form-item
form-option">
<label for="edit-field-sub-group-value-60" class="option"><input
type="checkbox" class="form-checkbox" value="60"
id="edit-field-sub-group-value-60" name="field_sub_group[value][60]">
Coordination</label>
<div class="description">taxonomy term's help text goes here</div>
</div>
The data is in the term's table, somewhere along the chain the data is
loaded by the cck-content taxonomy module, or theme hook, the exact
place is still elusive to me...?
If anyone knows where or how to add description to cck check box
renderings, even as a "hack" with a second term load to populate the
form's $output, that would be appreciated.
I'm posting this question here as well as on the issue queue, in the
hopes that perhaps someone with more framework understanding can guide
me along my windy path.
Thanks!
Sebastian.
More information about the support
mailing list