Panelizer saves overriden panelized node displays separately when you override the default display. This can quickly get problematic. Manually adding a pane to all panelized nodes quickly stops beeing a viable option when there are 50+ overridden panelized nodes.
One possible option (That merlinofchaos suggests here #1869784: A philosophical question about Panelizer workflow) is to add mini-panels to the default display for that places where you want to be able to add/remove/modify the panes globally (for all the nodes that were created using that default display.) That solution works great in some use cases unfortunately not for us. I can think these problems with this solution:
- In short it doesn't work well with an agile workflow. You have to early on (before any content using the default is created, or atleast overridden) decide where we might sometime want to add pane(s) globally
- Adding panes in between existing panes would require a mini panel between the panes..
- You loose IPE functionality for the individual panes that are inside of the mini-panel
I think it would be useful for panelizer to provide actions to add panes programmatically to overridden panelizer nodes.
TL;DR
We needed to add panes to existing overridden panelizer nodes so I created a Panelizer Bulk Update sandbox project with helper functions that we use in update hooks to add panes to existing overridden panelize nodes.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | panelizer_bulk_update-improvements-1901952-8.patch | 15.4 KB | RobDi |
Comments
Comment #1
merlinofchaos commentedThis isn't a bug, nor is it really fixable in any meaningful way.
Comment #2
merlinofchaos commentedThe big problem becomes...how? Propagating changes and merging them into user changes is really, really hard. It's relatively easy to talk about on a high level (I want to add this pane here and have all the panels actually get it) but difficult once you talk about specifics (Well on the master it goes between the Red ad pane and the Blue ad pane, but on 4 of these panels they moved the red ad pane to the other side bar. Where does it go on those panels?)
It's not something you can do without having a very good, forward-thinking strategy, and thus can't really tack onto an existing system. At some point you end up asking the software to try to read your mind.
Comment #3
merlinofchaos commentedComment #4
emattias commentedProviding actions to easily add panes to all the overrides in the beginning or end of regions is one way to approach this. Panelizer_bulk_update has functions that does this at time of writing. We will probably soon add the ability to add a pane in a certain position later.
Another approach might be to have "dynamic/global" regions that work pretty much like the mini-panel solution does. It would be nice to have "global" regions that doesn't break IPE. My thinking is that instead of storing that region seperately per overridden node that region is pulled from the default display so when the default is changed it will propagate to overridden nodes also.
Comment #5
merlinofchaos commentedYou're assuming that the layout isn't changed.
Comment #6
emattias commentedNo, in the helper function to add a pane it filters out by node type & layout. So it will only add to the overridden nodes whose displays are using the specified layout.
My thinking is you have to specify the used layout and region to add to when running the action.
Comment #7
merlinofchaos commentedI'd say you're welcome to try, but such a patch is complicated, very involved, has an extremely difficult UI, and will take probably weeks of developer time. It's not likely to end up on my TODO list.
Comment #8
RobDi commentedI've been working on a similar problem, we also need editors with no php knowledge to be able to apply bulk operations to content. I've worked on some significant changes to the Panelizer Bulk Update sandbox module.
If I had more time I would like to be able to use the standard panels/panelizer add content method to specify which panes to add. Also, I have only a couple months of drupal/php/web development experience, so any feedback is appreciated.
Comment #9
idealdesigns commentedHow to use Panelizer Bulk Update sandbox module?
is it safe?
Comment #10
idealdesigns commentedThe patch does not apply ?
Comment #11
RobDi commentedIssue with line endings, running dos2unix on module before patching works temporarily but I'll look into a proper fix. Again, this is something new to me, so thanks for patience.
Edit: Actually, having looked at https://drupal.org/coding-standards#indenting seems as though the original files should have unix line endings anyway as opposed to DOS.
Comment #12
damienmckennaNeeds work, though it may be just scrapped in favor of fixing the VBO integration (#2214221: Fix Views_Bulk_Operations (VBO) integration).