I have created a custom view mode for field collections with this code:
/**
* Implements hook_entity_info_alter().
*/
function view_modes_entity_info_alter(&$entity_info) {
$entity_info['field_collection_item']['view modes']['myviewmode'] = array(
'label' => t('My view mode'),
'custom settings' => TRUE,
);
}
And I'm trying to render the field in the node.tpl.php using the view mode with this code:
$display = array(
'label' => 'hidden',
'type' => '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!