You are here

function hook_field_token_value_output_alter in Field Token Value 8

Same name and namespace in other branches
  1. 7 field_token_value.api.php \hook_field_token_value_output_alter()
  2. 2.x field_token_value.api.php \hook_field_token_value_output_alter()

Allow modules to alter the output of field_token_value fields prior to render.

Parameters

array $element: The html_tag render array to be altered.

array $wrapper_info: An array containing the information for the wrapper to be used.

File

./field_token_value.api.php, line 21
Describes API functions for field_token_value module.

Code

function hook_field_token_value_output_alter(&$element, $wrapper_info) {

  // Attach a CSS file if the paragraph wrapper is being used.
  if ($wrapper_info['tag'] == 'p') {
    $element['#attached']['css'][] = drupal_get_path('module', 'my_module') . '/css/my-styles.css';
  }
}