# In a module file:
This will enable an additional view mode for use on the specified entity type(s). Many examples will show the `custom settings` here being set to TRUE. If TRUE is used then that view mode is added to all entities of the specified type regardless of if it should be on the bundle or not.
```php
/**
* Implements hook_entity_info_alter().
*/
function HOOK_entity_info_alter(&$entity_info) {
$entity_info['node']['view modes'] += array(
'view_mode_machine_name' => array(
'label' => t('View mode display name'),
'custom settings' => FALSE,
),
);
return $entity_info;
}
```
Where "view_mode_machine_name" is the machine name of the view mode you want to add (ex: sidebar).