It seems that the label that I have configure my addressfield with is not appearing on the widget form. Bellow are a couple lines that I modified in the function addressfield_widget_form() to get the label to appear. I'm not assuming this is a well thought solution (though a fieldset is a nice idea to contain all the elements) but at least it's a start.
Here's the DIFF:
--- a/sites/all/modules/addressfield/addressfield.module
+++ b/sites/all/modules/addressfield/addressfield.module
@@ -173,10 +173,12 @@ function addressfield_field_widget_form(&$form, &$form_state, $field, $instance,
$country_list = array_intersect_key($country_list, $settings['available_countries']);
}
+ $element['#type'] = 'fieldset';
+ $element['#title'] = t($instance['label']);
$wrapper_id = drupal_html_class($field_name) . '-addressfield-wrapper';
$element['#prefix'] = '<div id="' . $wrapper_id . '">';
$element['#suffix'] = '</div>';
$element['country'] = array(
'#type' => 'select',
'#title' => t('Country'),
Attached are a couple before and after screenshots.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 861848-af-fieldset-wrapper.patch | 983 bytes | damien tournoud |
| after : with fieldset and label | 24.78 KB | manimejia | |
| before : with no label | 21.21 KB | manimejia |
Comments
Comment #1
rszrama commentedAgreed, having a fieldset with a label makes sense. I'm not sure if we'll make this a mandatory thing like it is in your patch, though. Will confer w/ Damien, and I'm interested in feedback from anyone else as well.
Comment #2
damien tournoud commentedDiscussed with Ryan and Bohjan and decided to move forward with the fieldset idea. Definitely not the best looking element, but we don't have a lot of alternatives.
Committed the attached patch.