Currently, as far as I could see it is only possible to create one type of Fieldable panels pane, add fields and create panes from. But what if I would want to create a pane that contains a list of links and an other pane that contains some text. Then I would be forced to use the only Fieldable panels pane available and add both a textfield and a link field to it. And although quite possible, it does clutter the forms with partly unused fields.

Comments

merlinofchaos’s picture

Status: Active » Fixed

You should consider reading either the project page or the included README.txt file; this topic is addressed in both places.

merlinofchaos’s picture

To make it easier to find, here is the direct link to the README:
http://drupalcode.org/project/fieldable_panels_panes.git/blob/refs/heads...

Argus’s picture

Ah rtfm... my bad. I was sure there was a way to code it, but to specify my request, would it be possible to have a UI for that?

As for the info on the project page: "Bundles are supported and can be added via hook_entity_info_alter()." doesn't really say much to none-coders like myself, so I tend to read over it.. (meh code-stuff => ignore)

merlinofchaos’s picture

UI for this is complex to write and can degrade performance. At the moment it's not on my priority list to spend time on it. It might happen at some point, but it's not on my current priority list.

filipnest’s picture

StatusFileSize
new766 bytes

@Argus in case you need help on the manual bundle creation:

I'm no expert, so hopefully this isn't completely wrong, but here's a guide:

Create a new module for your extra bundle(s). Calling it, for example, "panebundles".

Do this by creating a directory called "panebundles" and inside it create two files. One called panebundles.info and the other called panebundles.module (use notepad or something similar and save as "all files" to get the extensions).

In the info file, put something like:

name = Panel Bundles
description = Module adding more bundles for Fieldable Panels Panes.
package = "Panels"
core = 7.x
files[] = panebundles.module
dependencies[] = "fieldable_panels_panes"

Then, in the .module file put:

<?php
function panebundles_entity_info_alter(&$entity_info) {
$entity_info['fieldable_panels_pane']['bundles']['newbundle'] = array(
'label' => t('New Bundle'),
'pane category' => t('New Bundle Category'),
'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/panels/entity/manage/%fieldable_panels_panes_type',
'bundle argument' => 5,
// Note that this has all _ replaced with - from the bundle name.
'real path' => 'admin/structure/panels/entity/manage/newbundle',
'access arguments' => array('administer fieldable panels panes'),
),
);
}

Change "newbundle" etc to your bundle name and "panebundles" to your module name. You should be able to chain multiple of those snippets in one file to create multiple extra pane types but to do this start with the "$entity_info" part not the function and leave off the final ");
}" until the end. If you're doing this also change the "bundle argument" to another number for each new bundle.

Install and enable it like you would another module and the new bundle(s) should appear.

I hope that works for you. I've attached a working extra bundle module as well in case that's more helpful.

Argus’s picture

Ah that is really great, thanks very much! That should get me started. :)

cangeceiro’s picture

Component: Code » Documentation
Assigned: Unassigned » cangeceiro
Status: Fixed » Needs work

moving to needs work and documentation. @Blue_Jumpers_Filip's comment in #5 would be really useful in the documentation. I'll add this when i have some extra time to work on this.

Argus’s picture

Finally got around trying this. When I add the module extrapane you provided and enable it, I get the following error when trying to edit the fields of both the ORIGINAL bundle provided (at ../admin/structure/panels/entity/manage/fieldable-panels-pane/fields) AND the extrapane module at ../admin/structure/panels/entity/manage/extrabundle/fields.

Notice: Undefined index: in _field_ui_bundle_admin_path() (line 325 of ../modules/field_ui/field_ui.module).

Argus’s picture

Ah found the cause: there is a typo in the code, it should read

'bundle argument' => 5,

instead of 'bundle argument' => 15,

cangeceiro’s picture

Status: Needs work » Closed (fixed)

just realized this is already in the readme

zhuber’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new8.31 KB

I have patched this so that users can create and delete bundles from the UI. I'm not sure if it is exactly what you guys had in mind originally, but it seems like a good stepping stone. I ran my changes through the coder module, but let me know if I need to change anything.

One thing to note is that it still requires you to clear the cache after creating or deleting bundles in order to see the changes.

merlinofchaos’s picture

Status: Needs review » Closed (duplicate)

There is already a pretty good patch marked 'needs review' that provides an extensive UI to add/remove bundles.

See #1618308: User interface for managing bundles

joeysantiago’s picture

Hello,

i followed the insctuction on the readme file and had the

Notice: Undefined index: in _field_ui_bundle_admin_path() (line 325 of ../modules/field_ui/field_ui.module).

problem mentioned in #8. Actually i patched id by using

'bundle argument' => 4,

as it is set in fieldable_panels_panes.module, line 40.

davidneedham’s picture

Status: Closed (duplicate) » Needs review

Created a new issue and patch for updating README.txt with 'bundle argument' => 4,. #1762362: Fix bundle argument in example in README.txt

davidneedham’s picture

Status: Needs review » Closed (duplicate)
aniket.mohite88’s picture

Issue summary: View changes

Thanks guys,

I have been through the read-me file & it gives the facility to add more bundles. Just as my requirement.
This helped.

granticusiv’s picture

Just in case anyone else gets caught on this, the link to the readme file shows:
'path' => 'admin/structure/fieldable-panels-panes/manage/%fieldable_panels_pane_type',

where it should show:
'path' => 'admin/structure/fieldable-panels-panes/manage/%fieldable_panels_panes_type',

I noted in version 7.x-1.5 that the 'bundle argument' => 4