1

Here's what I want to do, for context:

I want to go to mysite.com/groups/%gid/%nid and see the node specified by %nid with an OG menu and a header pane that get their context based on the %gid. So if I have, say, a "person" nodetype, I can show a person node that belongs to multiple groups with the header and menu of different groups based on the URL. This is useful because then I can change the links that I use in each group's "people" list to keep the header and menu the same after the user clicks on the person.

I am not able to get the two arguments to work together, though.

I have been able to create a Views pane that displays the node by taking nid as a contextual filter, and gets it from the URL via panels. However, when I try to add the %gid first, I get all lost. I can't figure out how to use it to tell OG Menu which menu I want, I don't know how to use it to pass the appropriate context to the header minipanel that I've created (that works when a valid context is passed in), and I get "page not found" instead of a person node.

What am I doing wrong? How do I get two arguments in a URL to work together to tell Panels what the context and content should be, respectively?

1 Answer 1

0

The problem is in this:

  $page->arguments = array(
    // Array key must be unique.
    'node' => array(
      'id' => 1,
      'identifier' => 'Node: ID',
      'name' => 'entity_id:node',
      'settings' => array(),
    ),
  );

I found workoroud for this problem. Create custom load hook that will be the similar to node or some else you need. Like this:

/**
 * Duplicates node load callback because panels can't have two same entities arguments.
 */
function mymodule_custom_load($nid) {
  return node_load($nid);
}

So to solve tis, you need to use %mymodule_custom instead of %node. Hope this will help somebody, because I search the answer for very long time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.