The first attached patch adds support for panels node.

It could still use a bit of work, but it allows you to select the panel layout you want and performs the necessary processing.

First patch adds the "includes/panels_node.node_convert.inc file.

The second patch is an improvement to node_convert_init() function, and is necessary for the new file to get loaded.

I didn't have time to get these more organized before sharing, but I thought someone would find it useful.

Comments

lee20’s picture

Oops. The node_convert-better-hook-init.patch wasn't quite right. Here is what I intended:

/**
 * Implementation of hook_init().
 */
function node_convert_init() {
  foreach (array('book', 'panels_node', 'forum') AS $module) {
    if (module_exists($module)) {
      module_load_include('node_convert.inc', 'node_convert', 'includes/' . $module);
    }
  }
}
lee20’s picture

Status: Active » Needs work
lee20’s picture

StatusFileSize
new2.92 KB

Posting a better patch which combines the first 2 patches into a single patch.

lee20’s picture

Status: Needs work » Needs review
jon nunan’s picture

Works well for me. My only note would be the look of the 'panel layout' list going down the page, though thats easily fixed with a bit of CSS.

Thanks!

lee20’s picture

Status: Needs review » Needs work
lee20’s picture

Status: Needs work » Needs review
StatusFileSize
new3.38 KB

Attached is a patch which does a better job of integrating with panels_node. It uses panels_choose_layout() to display the layout selection.

This patch also adds validation which wasn't in the previous patch and also corrects an issue with converting from a panels_node node to another type.

There is one known issue. If the conversion validation throws an error (click Convert without selecting a layout), the layout selection is no longer compacted and is a long list of options going down the page (as described by meatsack in #5). I'm not sure why the validation breaks this, but the form remains functional making it a pretty small issue.

Edit: Just wanted to mention that this patch was developed against Panels 3.7

lee20’s picture

StatusFileSize
new3.53 KB

Updated patch. Previous patch forgot to properly initialize the validation data.

alcroito’s picture

Status: Needs review » Fixed

Thanks. Edited your patch a bit, to make it work with panels-3.8.
Added to DEV.

Status: Fixed » Closed (fixed)

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