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.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | fieldable_panel_panes-bundle-creation-1526508.patch | 8.31 KB | zhuber |
| #5 | extrapane.zip | 766 bytes | filipnest |
Comments
Comment #1
merlinofchaos commentedYou should consider reading either the project page or the included README.txt file; this topic is addressed in both places.
Comment #2
merlinofchaos commentedTo make it easier to find, here is the direct link to the README:
http://drupalcode.org/project/fieldable_panels_panes.git/blob/refs/heads...
Comment #3
Argus commentedAh 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)
Comment #4
merlinofchaos commentedUI 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.
Comment #5
filipnest commented@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:
Then, in the .module file put:
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.
Comment #6
Argus commentedAh that is really great, thanks very much! That should get me started. :)
Comment #7
cangeceiro commentedmoving 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.
Comment #8
Argus commentedFinally 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.
Comment #9
Argus commentedAh found the cause: there is a typo in the code, it should read
'bundle argument' => 5,
instead of 'bundle argument' => 15,
Comment #10
cangeceiro commentedjust realized this is already in the readme
Comment #11
zhuber commentedI 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.
Comment #12
merlinofchaos commentedThere 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
Comment #13
joeysantiago commentedHello,
i followed the insctuction on the readme file and had the
problem mentioned in #8. Actually i patched id by using
as it is set in fieldable_panels_panes.module, line 40.
Comment #14
davidneedhamCreated a new issue and patch for updating README.txt with
'bundle argument' => 4,. #1762362: Fix bundle argument in example in README.txtComment #15
davidneedhamComment #16
aniket.mohite88 commentedThanks guys,
I have been through the read-me file & it gives the facility to add more bundles. Just as my requirement.
This helped.
Comment #17
granticusiv commentedJust 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