Alter field items before render I'd like to add an item to a multivalued image field rendered by the Field Slideshow module.
I need to display an image coming from field image B of entity B in the slideshow of field image A of entity A.
The Field Slideshow module implements hook_field_formatter_view.
I'd like to be able to add an item at the end of the $items variable of this function.
How can I do that ?
If someone comes here, use template_preprocess_field

In template.php :

function MYTHEME_preprocess_field(&amp;$variables) {
  $element = $variables['element'];

  if ($element['#field_name'] == 'field_myfield') {
    //Load the related node, I let you do this step ...
    //$nid = ...

    $nodeB = node_load($nid);
    $variables['items'][0]['#items'][] = $nodeB-&gt;field_another_image_field[LANGUAGE_NONE][0];
    //If you have a pager
    $variables['items'][0]['#pager']['#items'][] = $nodeB-&gt;field_another_image_field[LANGUAGE_NONE][0];
  }
}