Render field collection multiple times on node.tpl.php I have created a custom view mode for field collections with this code:

/**
 * Implements hook_entity_info_alter().
 */
function view_modes_entity_info_alter(&amp;$entity_info) {
  $entity_info['field_collection_item']['view modes']['myviewmode'] = array(
    'label' =&gt; t('My view mode'),
    'custom settings' =&gt; TRUE,
  );
}


And I'm trying to render the field in the node.tpl.php using the view mode with this code:

$display = array(
  'label' =&gt; 'hidden',
  'type' =&gt; 'myviewmode',
);
$output = field_view_field('node', $node, 'field_page_collection', $display);
print render($output);


But the field is rendering with the default view mode, not with the custom one I created. Is there a way to render it using the new view mode??

Thanks a lot!
You should read manual for field_view_field function.


Do not use inside node (or any other entity) templates; use render($content[FIELD_NAME]) instead.
Do not use to display all fields in an entity; use field_attach_prepare_view() and field_attach_view() instead.
The field_view_value() function can be used to output a single formatted field value, without label or wrapping field markup.