18 February 2015

Edit field output after the field module has performed the operation. This gives you possibility to alter the field output before rendered in your module. This works with display suite and other rendering extensions as well.

Source code viewer
  1. // https://api.drupal.org/api/drupal/modules!field!field.api.php/function/hook_field_attach_view_alter/7
  2.  
  3. /**
  4.  * Implements hook_field_attach_view_alter().
  5.  */
  6. function HOOK_field_attach_view_alter(&$output, $context) {
  7. if ($output['#entity_type'] === 'node' && $output['#bundle'] === 'article') {
  8.  
  9. }
  10. }
Programming Language: PHP