1 node_type_example.module | node_type_example_entity_info_alter(&$entity_info) |
Implements hook_entity_info_alter().
We need to modify the default node entity info by adding a new view mode to be used in functions like node_view() or node_build_content().
Related topics
File
- modules/
examples/ node_type_example/ node_type_example.module, line 152 - Hook implementations for the Node Type Example module.
Code
function node_type_example_entity_info_alter(&$entity_info) {
// Add our new view mode to the list of view modes.
$entity_info['node']['view modes']['node_type_example_list'] = array(
'label' => t('Example node list'),
'custom settings' => TRUE,
);
}