Submitted by mario on Wed, 26/01/2011 - 12:40
You can add extra display modes using hook_entity_info_alter.
Say you have a custom module 'myModule' and want to add a custom view to the node entity:
<?php
function myModule_entity_info_alter(&$entity_info) {
$mymode = array(
'label' => 'My Custom Mode',
'custom settings' => 'TRUE'
);
$entity_info['node']['view modes']['mymode'] = $mymode;
}
?>Flush caches and this should show up as a customisable view mode on the 'manage display' page of any node content type.
Hello
Blog
Video
Travel
Add new comment