function hook_field_formatter_settings_form

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 field_ui.api.php hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state)
cle7 field_ui.api.php hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state)
elmsmedia7 field_ui.api.php hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state)
icor7 field_ui.api.php hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state)
meedjum_blog7 field_ui.api.php hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state)
mooc7 field_ui.api.php hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state)

Specify the form elements for a formatter's settings.

Parameters

$field: The field structure being configured.

$instance: The instance structure being configured.

$view_mode: The view mode being configured.

$form: The (entire) configuration form array, which will usually have no use here.

$form_state: The form state of the (entire) configuration form.

Return value

The form elements for the formatter settings.

Related topics

21 functions implement hook_field_formatter_settings_form()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

ctools_fields_get_field_formatter_settings_form in sites/all/modules/ulmus/ctools/includes/fields.inc
Helper function for calling hook_field_formatter_settings_form() without needing to load an instance of the field.
date_field_formatter_settings_form in sites/all/modules/ulmus/date/date.field.inc
Implements hook_field_formatter_settings_form().
ds_field_formatter_settings_form in sites/all/modules/ulmus/ds/includes/ds.field_ui.inc
Implements hook_field_formatter_settings_form().
entityreference_field_formatter_settings_form in sites/all/modules/ulmus/entityreference/entityreference.module
Implements hook_field_formatter_settings_form().
field_collection_fieldset_field_formatter_settings_form in sites/all/modules/ulmus/field_collection_fieldset/field_collection_fieldset.module
Implements hook_field_formatter_settings_form().

... See full list

File

modules/field_ui/field_ui.api.php, line 151
Hooks provided by the Field UI module.

Code

function hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];

  $element = array();

  if ($display['type'] == 'text_trimmed' || $display['type'] == 'text_summary_or_trimmed') {
    $element['trim_length'] = array(
      '#title' => t('Length'),
      '#type' => 'textfield',
      '#size' => 20,
      '#default_value' => $settings['trim_length'],
      '#element_validate' => array('element_validate_integer_positive'),
      '#required' => TRUE,
    );
  }

  return $element;

}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.