From what I can tell, Node Hierarchy should be able to work with Panels, but I am not able to assign a parent to an existing panel page.

Also, when I go to the 'Children' tab on my parent and click 'Create new child Panel', it doesn't do anything (well, the browser loads something but the page looks the same afterward).

What am I missing? Thanks!

CommentFileSizeAuthor
#1 314251.patch313 bytesjbylsma

Comments

jbylsma’s picture

StatusFileSize
new313 bytes

You aren't missing anything :) I don't remember exactly what it was but there is a conflict between the multi-step panel node creation and node hierarchy. I think it comes from the destination variable in the generated link for creating panels. Anyways, I was working with a custom theme when I first discovered it, so I just overwrote it using a theme override. If you are doing the same, you can use this in your template.php:

function phptemplate_nodehierarchy_new_child_links($node) {
  $out = "";
  $create_links = array();

  if (user_access('create child nodes') && (user_access('create child of any parent') || node_access('update', $node))) {
    foreach (nodehierarchy_get_allowed_child_types($node->type) as $key) {
      if (node_access('create', $key)) {
        $type_name = node_get_types('name', $key);
        $destination = drupal_get_destination() ."&parent=$node->nid";
        if ($key == 'panel') {
          $destination = "parent=$node->nid";
        } else {
          $key = str_replace('_', '-', $key);
          $destination = drupal_get_destination() ."&parent=$node->nid";
        }
        $title = t('Add a new %s.', array('%s' => $type_name));
        $create_links[] = l($type_name, "node/add/$key", array('query' => $destination, 'attributes' => array('title' => $title)));
      }
    }
    if ($create_links) {
      $out = '<div class="newchild">'. t("Create new child !s", array('!s' => implode(" | ", $create_links))) .'</div>';
    }
  }
  return $out;
}

If you want to incorporate it into the nodehierarchy module, you can use the attached patch. I didn't post this before because I wasn't sure if you could create panel nodes with different content types (a content type not named "panel") or if you had a content type named "panel" that wasn't actually panel nodes. It should probably be a bit more robust in checking things.

Pillhuhn’s picture

Thanks for your response, jbylsma!

However, I am still confused and I guess the main reason is that I am VERY new to Drupal. I do not feel comfortable with adding code directly, mainly because I have no experience in programming. I did however apply the patch and it seemed to have worked somewhat since I now can create a panel directly from the 'Children' tab.

But I still cannot assign a parent to a Panel Page (I think it worked for Panel Nodes even before the patch). Maybe this is due by my lack of understanding the differences between a panel page and a panel node.

I guess I still need to do a lot more reading... :)

jbylsma’s picture

I think you already figured out your problem; if you want to hook panels in with Node Hierarchy, you will want to use Panel Nodes. Panel pages exist without a node, and therefore can't really operate with Node Hierarchy (at least, not without some serious work). However, just in case you are still running into problems with Panel Nodes, here are two things I can think of off the top of my head that might be screwing you up:

  • When you enable the panel_nodes, it should automatically create a new content type called "Panel." You will need to enable Node Hierarchy on the content type at /admin/content/types/panel give it the proper allowed child node types. (it sounds like you've already done this).
  • Panel nodes have a couple extra tabs "Panel layout" and "Panel content." However, the usual node settings should still be accessible within the "Edit" tab. With it properly hooked in with Node Hierarchy, you will be able to select a parent here.
jbylsma’s picture

Component: Code » Drupal/PHP Code
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

user654’s picture

.