I have created a custom field type. When creating a piece of content with this field type I get a select list and a text area like the image below. However, I have stated that the '#title' for the select list is Label and the textarea is Value.
These '#title''s I've given them do not show up. From looking at other modules that provide a field type that has multiple elements on its widget form seem to be doing it the same way but their titles show up.
function civsearch_property_labels_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
if (isset($items[$delta]['label'])) {
$default_label = $items[$delta]['label'];
}
if (isset($items[$delta]['value'])) {
$default_value = $items[$delta]['value'];
}
// We are unserializing the variable_get because the string that was
// serialized with variable_set was a serialized array. So we need to run the
// unserialize process one more time.
$options = array();
$list_items = unserialize(variable_get('civsearch_property_labels', ''));
foreach ($list_items as $list_item) {
$explode = explode('|', $list_item);
$options[$explode[0]] = $explode[1];
}
$labels = $element;
$labels += array(
'#type' => 'select',
'#title' => t('Label'),
'#options' => $options,
'#default_value' => isset($default_label) ? $default_label : '',
'#suffix' => '<br \>',
);
$values = $element;
$values += array(
'#type' => 'textarea',
'#title' => t('Value'),
'#default_value' => isset($default_value) ? $default_value : '',
);
return array(
'label' => $labels,
'value' => $values,
);
}