You are here

function hook_field_collection_item_view in Field collection 7

Act on a field collection item that is being assembled before rendering.

The module may add elements to $field_collection_item->content prior to rendering. The structure of $field_collection_item->content is a renderable array as expected by drupal_render().

Parameters

$field_collection_item: The field collection item entity.

$view_mode: The view mode the field collection item is rendered in.

$langcode: The language code used for rendering.

See also

hook_entity_prepare_view()

hook_entity_view()

File

./field_collection.api.php, line 149
Contains API documentation and examples for the Field Collection.

Code

function hook_field_collection_item_view($field_collection_item, $view_mode, $langcode) {
  $field_collection_item->content['my_additional_field'] = array(
    '#markup' => $additional_field,
    '#weight' => 10,
    '#theme' => 'mymodule_my_additional_field',
  );
}