You are here

function hook_bean_types in Bean (for Drupal 7) 7

Implements hook_bean_types().

Beans uses ctools plugins to define the block types. All plugin files must be registered in the .info file.

3 functions implement hook_bean_types()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

bean_admin_ui_bean_types in bean_admin_ui/bean_admin_ui.module
Implements hook_bean_types().
bean_bean_types in ./bean.module
Implements hook_bean_types().
bean_test_bean_types in tests/bean_test.module
Implements hook_bean_types().

File

./bean.api.php, line 23

Code

function hook_bean_types() {
  $plugins = array();
  $plugins['plugin_key'] = array(
    'label' => t('Title'),
    'description' => t('Description'),
    // This is optional. Set it to TRUE if you do not want the plugin to be
    // displayed in the UI.
    'abstract' => FALSE,
    'handler' => array(
      'class' => 'ClassName',
      'parent' => 'bean',
      // This should be pointing to the path of your custom bean plugin module.
      'path' => drupal_get_path('module', 'example_bean') . '/plugins',
      // Class files should be named accordingly in order to support ctools
      // autoloading procedures.
      'file' => 'ClassName.class.php',
    ),
  );
  return $plugins;
}