Created
August 29, 2016 14:37
-
-
Save opi/87ea03b28026c43873fc8b4780cc47a7 to your computer and use it in GitHub Desktop.
Drupal 7 custom view mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_entity_info_alter(). | |
* | |
* Add view modes . | |
*/ | |
function MYMODULE_entity_info_alter(&$entity_info) { | |
// Add 'listing' view mode | |
$entity_info['node']['view modes']['listing'] = array( | |
'label' => t("Listing"), | |
'custom settings' => FALSE, // Do not enable this view mode for all content types by default | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment