2

I recall in previous versions (Or maybe even this version and mine is just bugging) you could take text or int fields and supply a list of key|values and make checkboxes or a selectbox from it.

The core module "Options" seems to offer this functionality from the module description but whenever I select field type Integer, Decimal, Float, or text the only widget option I have is a standard textbox.

Term and node references do allow checkbox widgets.

Am I seeing a bug? Is there a different way of doing this in D7? I've tried adding these field types to both node types and vocabs but neither acknowledges the existence of the checkboxes widget.

2

Set "Type of data to store" to List (text), List (integer) or List (float) and Check boxes will be default widget. If you can't see them, make sure List module is enabled.

2

No this isn't a bug. The options module doesn't itself define any field types for which it can be used. This is left to modules wishing to implement hook_field_widget_info_alter() and add to the field types property.

For example, the taxonomy module provides that functionality through taxonomy_field_widget_form_alter():

function taxonomy_field_widget_info_alter(&$info) {
  $info['options_select']['field types'][] = 'taxonomy_term_reference';
  $info['options_buttons']['field types'][] = 'taxonomy_term_reference';
}

The number module doesn't implement that hook, so you can be pretty sure the behaviour you see is by design.

The list types are instead provided by the List module (List(Text), List(integer), etc.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.