Download & Extend

Ability to clone mini-panels

Project:Panels
Version:6.x-3.0
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

Title:Ability to link to clone module/clone panels.» Ability to clone content items and minipanels
Version:4.7.x-1.x-dev» 5.x-2.x-dev
Component:Miscellaneous» Code

I 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).

#2

Title:Ability to clone content items and minipanels» Ability to clone

Why 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.

#3

Anything 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.

#4

Subscribing.

#5

BTW, 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.

#6

Title:Ability to clone» Ability to clone panel displays, mini panels, etc

I'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.

#7

Status:active» needs work

Heh...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.

#8

Seems 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.

#9

@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.

#10

@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.

#11

For 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.

#12

Title:Ability to clone panel displays, mini panels, etc» Ability to clone mini-panels
Version:5.x-2.x-dev» 6.x-3.0

Everything but minipanels is clonable in the 6.x-3.x line. Updating issue to mark this more accurately.

#13

Is there going to be any work on being able to clone mini-panels in the near future?

#14

Status:needs work» fixed

With conversion to the export-ui, Mini Panels gained the ability to be cloned.

#15

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here