Skip to content

Instantly share code, notes, and snippets.

@sebcunin
Last active December 20, 2015 10:59
Show Gist options
  • Select an option

  • Save sebcunin/6120095 to your computer and use it in GitHub Desktop.

Select an option

Save sebcunin/6120095 to your computer and use it in GitHub Desktop.
Création d'un nouveau mode d'affichage pour l'entité Node
<?php
/**
* Implements hook_entity_info_alter().
* @link http://www.wunderkraut.com/blog/drupal-7-custom-node-view-modes/2010-12-20
*/
function MYMODULE_entity_info_alter(&$entity_info) {
$entity_info['node']['view modes']['another_teaser'] = array(
'label' => t('Another teaser'),
'custom settings' => FALSE, // TRUE pour avoir le nouveau d'affichage déjà activé dans l'onglet Custom display settings
);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment