Usage

Last updated on
8 December 2018

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

How Beans interface with Blocks

Each bean instance has a corresponding block. Users interact with them in the same way they might use any other block in Drupal. The Bean module does not attempt to interface with the placement of blocks. Bean deals only with the creation of customized, fieldable blocks.

Block Types

Like "Content Types" for nodes, beans have Block Types. A block type is the bundle for a set of block entities (aka beans). Block Types define the configuration model for each individual bean.

How to make a Block Type

Users can create new block types through using the Bean UI or they can program new block types as bean plugins in code within their modules.

http://youtu.be/Eu1YNy-BNG8 - Bean Admin UI Tutorial

How to make a Bean

Once a block type has been defined, one can make a bean (block entity) through the admin UI.

  1. Visit: /block/add.
  2. Choose the type of block that you would like to create and use the form to create a new bean.
  3. Block placement and configuration can be handled through the Blocks system or contribs that deal with block placement (ie: context, display suite et al).

Developer Documentation

See Bean Examples for an up-to-date plugin implementation.

If you have already implemented Bean plugins, keep an eye on the API changes.

Themer Documentation

In the case where a Bean plugin provides a .tpl file, theme output of the Bean can be overridden. Output for node listings inside a Bean often make use of view modes- these can be styled according to the ID selector of the individual Bean or the class wrapper for the entire Bean type.

Articles and Videos

Warning for Bean All Module

Note that the Bean All module will hijack the core block system (by design) which will prevent you from putting blocks into regions using the core block UI. This has caused some confusion during development for some so this warning has been added to help future developers!

https://drupal.org/node/1912354

Help improve this page

Page status: No known problems

You can: