Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello
I'm trying to implement a formatter to a decimal defined computed field, using hooks
hook_field_formatter_info
hook_field_formatter_settings_form
hook_field_formatter_settings_summary
hook_field_formatter_view
but can't get the formatter (my_computed_field_formater) appears in the list of formaters for the computed field (neither on views or content type display settings)
I'm guessing I can't figure out what is the copmuted field "type" that should be defined at hook_field_formatter_info, I've tried
function my_module_field_formatter_info(){
return array(
'my_computed_field_formatter' => array(
'label' => t('My label'),
'field types' => array('number_decimal'),
'settings' => array(
'prefix' => '$',
),
),
);
}
is this the correct way to do define the computed formatter on hook_field_formatter_info ?
please any help is welcome, thanks
Comments