How to create Fieldable Panel Panes bundles or types

Preksha Patel's picture

How to create Fieldable Panel Panes bundles or types

As you know, the entity, fieldable panel pane is a powerful feature in Drupal. Since they are fieldable entities, they can contain any kind of data that field API can provide. Fieldable panel pane is very effective to add block content and display contents in a structured way.

Fieldable panel pane by default provides many bundles. you can also create bundle of fieldable panel pane entity as per your requirement.It can be done in a your module via hook_entity_info_alter() and it will look like this:

function your_module_name_entity_info_alter(&$entity_info) {
$entity_info['fieldable_panels_pane']['bundles']['your_bundle_name'] = array(
'label' => t('Your bundle name'),
'pane category' => t('Your category name'),
'pane top level' => FALSE, // set to true to make this show as a top level icon
'pane icon' => '/path/to/custom/icon/for/this/pane.png',
'admin' => array(
'path' => 'admin/structure/fieldable-panels-panes/manage/%fieldable_panels_panes_type',
'bundle argument' => 4,
// Note that this has all _ replaced with - from the bundle name.
'real path' => 'admin/structure/fieldable-panels-panes/manage/your-bundle-name',
'access arguments' => array('administer fieldable panels panes'),
),
);
}

Now you can add different fields in your created bundle of Fieldable Panel Pane.
Cheers!!!