I love og_panels for its ability to create group specific pages, but it's lacking the import/export functionalities that normal panels do. I created a following patch to version 6.x-2.x-dev of 09/05/2009, it will an extra form on top of each og panel's edit content page, you can see the current og panel page's exported code, and you can copy that code, go to another og panel page, and import the new code, so basically you can fulfill og panels cloning.

Comments

maxelrod’s picture

This is a welcome addition. However this only partly worked for us. The import failed to bring in the entire layout. It only brought in the center pane. (of four)

jimthunderbird’s picture

Thanks for the feedback, the patch works for me, I will test it more and fix it.

jimthunderbird’s picture

Hi maxelrod,
I've retested my patch and it works for me. Here's what I did:

1. do a fresh install of Drupal 6.14.
2. patch og_panels 6.x-2.x-dev (the latest version) with my import/export patch
3. create a new group
4. create a new og_panel, set the layout to be default, add og_description, powered by drupal block, a custom content block into that panel.
5. copy the exported code of that panel.
6. create a new og_panel again, click on "edit content", click on import from code, then paste the code i copy in step 5, then hit "Save"

Now the second og panels has the same content and layout as the first one.

My testing environment is: Fedora Core 11 + Apache/2.2.11 (Unix) + MySQL 5.1.33 Source distribution + PHP 5.2.9 (cli)

I'm thinking, maybe you have the "show block" option on in your panel? The drupal default block system is different from the panel layout, maybe what you are experiencing is because you have some blocks turn on in your left sidebar, so even though the panels layout and content are ported over, you still have the left sidebar on.

Could you maybe give me the detail steps on how you produce the error so I have better understanding?

Thanks.

maxelrod’s picture

StatusFileSize
new2.19 KB

I ran through the test you describe and your test works fine for me. The problem I'm encountering is when working with the flexible layout. Here are the steps to recreate the problem I am observing. (We are running drupal 6-14 and php 5.2.10)

1. create a new group
2. create a new og_panel, set the layout to be "flexible"
3. Add a region to the right so we now have two regions. center and right
4. Add content: add og_description to "center" region, add powered by drupal block,to right region.
5. copy the exported code of that panel.
6. create a new og_panel again, click on "edit content", click on import from code, then paste the code copied in step 5, then hit "import".

Now what you will see is the "center" region was imported. but the "right" region with the powered by drupal widget is missing. I'm attaching my import/export code in case it helps

jimthunderbird’s picture

StatusFileSize
new6.88 KB

Hi Maxelrod,
Thanks a lot for the testing. It really helps to nail down the problem. I've created another patch and it should be working now. I've added layout, layout_settings, panel_settings, cache, title, hide_title, title_pane field updates into one sql. Previously only layout has been updated. You testing really helps a lot. Thanks again. Please let me know if the new patch works for you.

Best Regards,
Jim

maxelrod’s picture

Very good! This one looks like a keeper. I tested it with the procedure mentioned above. I also tested it with and without the "show blocks" option. Works like a charm.

Thanks indeed,

Mike

foxtrotcharlie’s picture

Jim - This works brilliantly - you've saved me a lot of time. You ROCK! :-)

I've tested on about 7 panel pages, and it works well so far. Still got a number more to test, so if I run into any issues, I'll give feedback here.

cbassig’s picture

Just applied this patch.... Works great and was exactly what I needed.

Thanks for posting!!

boran’s picture

subscribe- want to track when this patch gets included..

populist’s picture

Status: Active » Fixed

this is amazing. committed to -dev!

Status: Fixed » Closed (fixed)

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

ñull’s picture

Status: Closed (fixed) » Needs work

I like it what it offers, but couldn't it be also that the layout is included in this export and import, either separately or combined?

populist’s picture

Status: Needs work » Fixed

I am going to close this since the original issue has been met, but feel free to open another if you want the layout importing/exporting.

Status: Fixed » Closed (fixed)

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