Closed (fixed)
Project:
Panels
Version:
6.x-3.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
22 Oct 2006 at 19:09 UTC
Updated:
20 Feb 2023 at 15:41 UTC
The module that allows you to clone other nodes makes life a lot easier when creating a lot of similar nodes, doing the same for panels would make a lot of sense.
Great module otherwise though!
Comments
Comment #1
moshe weitzman commentedI am enjoying my first foray into panels2. To remove some drone work, it would be swell if I could clone minipanels. I have a similar need which is to clone content items in a panel. then i would go in and just change one View argument (for example).
Comment #2
dwwWhy stop there? Let's be able to clone panel pages, panel nodes, mini-panels, and content items. Earl, if you'd rather work on all of these as separate issues/patches, that's fine, but this is the oldest I found in the panels issue queue about "clone", and I figured we should have a primary issue about all of it, with the most general title. I might get inspired to work on some of this in the near future.
Comment #3
merlinofchaos commentedAnything that is exportable is easily cloned. That'll include panel pages and mini panels. Panel nodes, however, are not likely to be exportable, because they're tied to nodes and I'm not going to try to export a node.
Comment #4
wim leersSubscribing.
Comment #5
merlinofchaos commentedBTW, is anyone interested in working up a patch? Cloning should be as easy as doing an export, running that code through drupal_eval() and sending the resultant object into the add routine, which will basically then look just like an import as far as the system is concerned. Should be child's play.
Comment #6
dwwI've got this working on http://socialistworker.org now. I'm even saving a historical archive of panel displays, so you can do back in time and see what the front page looked like on a specific day, e.g.:
http://socialistworker.org/archive/front/2008/05/01
However, it's all via some custom code that associates each panel display with a date, and I save these things in a separate table. I'm not sure how to generalize this.
Also, because we needed it in our case, when you "clone" the draft display to the live front page, we also iterate over every node included in the panel and automatically publish it. Again, very slick if you need it, annoying if you don't.
So, ideas on how to generalize this stuff and/or how the UI should look are welcome. Once I have a plan, I'm happy to convert the custom code I have on that site into something the rest of the community could use.
Comment #7
sdboyer commentedHeh...interesting issue you chose to attach this to, dww :) I'd love to take a look at the code that you came up with and see how it compares with the way that blueprints operates; as we discussed on IRC, keeping track of timestamped, titled, etc. revisions is a big piece of what blueprints is all about, so I suspect that there's a joint route in there worth pursuing when it comes to genericizing.
Incidentally, the original request in this thread - building in the capacity to duplicate panes & displays are only somewhat related features. The capacity to clone displays has been around for a while, but I only just wrote an initial version of the API for cloning panes a week or so ago. It needs to be extended to include UI options & such, but I wrote them as methods in the panels_display object.
I'm marking this as to-be-ported to remind me to finish it off, or at least assess how long doing so would take.
Comment #8
moshe weitzman commentedSeems like merlin's proposal is pretty straightforward. Anyone?
Also, I need to do exactly what Derek is doing for a newspaper. We ought to find a place to share such code.
Comment #9
dww@moshe: Yes, the actual clone part of my code is indeed child's play, basically as outlined by merlin.
The harder part is making my stuff more generally useful to the outside world. I'm happy to share, I just don't know where/how, without taking some time to a) think about generalizing it and b) doing the work.
Comment #10
moshe weitzman commented@dww - i think sharing custom code is fine here without bothering to generalize or clean up. competent developers will just take what they need. you can post it here or send to me via email if you really prefer not to show the dirty laundry.
Comment #11
dwwFor now, I just emailed some code to moshe, but I'll consider getting it to a share-able state and either posting it here or turning it into its own module or something.
Comment #12
esmerel commentedEverything but minipanels is clonable in the 6.x-3.x line. Updating issue to mark this more accurately.
Comment #13
msumme commentedIs there going to be any work on being able to clone mini-panels in the near future?
Comment #14
merlinofchaos commentedWith conversion to the export-ui, Mini Panels gained the ability to be cloned.