Slice and Dice Entities with View Modes and Bean Entity View

Want to use a node as a block without creating a View or a block in custom code? Or maybe display a few fields of a node in a different region, but don’t want to add the overhead and complexity of Panels or Display Suite?

Introducing Bean Entity View!

This freshly-minted module builds on Bean to provide a bean type for displaying an entity using a particular view mode. To start, there are only three basic configuration options:

  1. Type of entity to display
  2. View mode of that entity to render
  3. Specific entity to render

Bean entity view creation screenshot

The first two options are straightforward while the third option provides two main choices: enter a specific entity ID or leave the field blank to attempt to render the entity that the current page is displaying. To help the plugin determine which entity you are currently viewing, you may set which position in the url the entity id should be located in. For nodes (node/1234) the position would be 1, while for RedHen contacts (redhen/contact/1234) the position would be 2.

Using the option to display a view mode of the current entity allows for displaying different displays of an entity across several page regions. In addition to the default/full page view of the node, Bean Entity View beans are used to render a header view mode in the header region and a sidebar view mode in the sidebar region.

Example of using multiple view modes and the contextual option

A beta release is available on drupal.org and this module is already used on several projects, so the code is stable and ready for use. Patches to support block caching or other improvements are welcome!

Get In Touch

Questions? Comments? We want to know! Drop us a line and let’s start talking.

Learn More
Get In Touch