Labels for CCK single on/off checkbox field aren't appearing - some solutions
One solution of the missing labels for CCK single on/off checkbox field is to allow Unlimited values, even if you only have one value to choose. For instance if you have CCK field "Auto publish" and you want one checkbox with the label "Auto publish" and the value besides the checkbox, like "Yes". One drawback of this is that the value don't appear on edit page...
- Select Integer
- Select single on/off checkbox
- Number of values: Unlimited
- Allowed values list:
1|Yes
Another solution is if you have your own module. Create a form_alter hook and add something like:
<?php
function mymodule_form_alter(&$form, &$form_state, $form_id) {
case 'mycontenttype_node_form':
$form['field_auto_publish']['#title'] = "Auto publish";
break;
}
?>Another solution is to hack the CCK optionwidget.module.
Source: http://drupal.org/node/115026#comment-1476332
<?php
- '#title' => isset($options[$on_value]) ? $options[$on_value] : '',
+ '#title' => t($field['widget']['label']),
?>Knowledge keywords:
