Usage
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.
- Visit: /block/add.
- Choose the type of block that you would like to create and use the form to create a new bean.
- 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
- http://www.phase2technology.com/blog/building-custom-block-entities-with...
- https://gist.github.com/1460818
- Drupal Bean module tutorial
- http://youtu.be/Eu1YNy-BNG8 - Bean Admin UI Tutorial
- https://github.com/skwashd/bean_boxes - Easily convert Boxes to Beans
- Views without Views
- An Introduction to Bean Module
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!
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion