Drupal 7 makes it quite easy to create a new view mode (see this tutorial for instance), but is there a way to define a view mode that is only available for a specific bundle (content type)?



View modes are specified per entity type, not bundle, as hook_entity_info() shows.

It is also not possible to define extra fields which are only available for a specific bundle/view mode combination, only per bundle.

  • 1
    OK, I sort of expected this answer. Thanks for confirming that it can't be done. – marcvangend Jun 22 '11 at 19:42
  • 1
    How about specifying it for entity, but make it enabled by default only for a bundle (say your custom content type), and leave disabled for other content types? – Елин Й. Sep 6 '13 at 8:15

The Drupal contrib module Entity View Mode lets you create view modes and specify for which specific bundles: Article, Basic page, etc.

  • 5
    No, not really. Entity View Mode only lets you specify the bundles where the 'custom display settings' for the newly created view mode must be enabled initially. Regardless of the custom display settings, a view mode is available for all bundles of the entity type. – marcvangend Oct 9 '13 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.