Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This module allows you to define view modes for nodes or other entity types using your theme's .info file.
The module will scan all *enabled* themes for declared view modes.
To use, enable the module and then place the following snippet in your theme's .info file:
; View Modes
; To add view modes for NODES (and not other entity types) in the simplest way possible:
; viewmodes[] = The label of the node view mode
; For advanced control of the view mode's machine name, label, and entity type, use the form:
; viewmodes[machine_name][entity_type] = The label of the entity's view mode
Some examples:
; View mode for nodes (machine name will be my_node_view_mode_label)
viewmodes[] = My Node View Mode Label
; View mode for an entity type of 'my_entity_type' with machine name 'my_mode' and human-readable label of "My entity mode"
viewmodes[my_mode][my_entity_type] = My entity mode
Remember to clear Drupal's cache after editing a theme's info file.
Sponsored and developed by TrestleMedia
Project information
- Maintenance fixes only
Considered feature-complete by its maintainers. - 1 site reports using this module
- Created by justindodge on , updated
- Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
Releases
7.x-1.0-beta1
released 4 June 2015
Works with Drupal: 7.x
✓ Recommended by the project’s maintainer.