I'm loading a group node from a custom menu item I've created in a module. The reason I've created a custom menu item is because I wanted to use a different path than the one associated with the node.
I have a panel with a selection rule set to all group nodes. The custom menu item works and loads the group node, however, the panel is not being activated. I think it is something to do with the way I am loading the node from my hook_menu function which is preventing the context from being activated. The code I'm using is:
function mymodule_menu() {
$items['course/course-1/resources'] = array(
'title' => 'Resources',
'access callback' => TRUE,
'page callback' => '_getpage1',
'page arguments' => array(1),
'type' => MENU_NORMAL_ITEM,
'menu_name' => 'menu-course-menu',
'weight' => '1',
);
return $items;
}
function _getpage1($arg1) {
$path = drupal_get_normal_path("course/" . $arg1);
$node=menu_get_object('node',1,$path);
return node_page_view($node);
}
Is there anything I need to add to activate the context for the group?
Many thanks,
Ben
ADDTIONAL INFORMATION:
I have two variants set up.
For the first:
Selection rule: Node is an OG group AND path matches "course/*/resources".
Context: No context is set
Relationship: OG Group from node
For the second:
Selection rule: Node is an OG group.
Context: No context is set
Relationship: OG Group from node
The first variant is supposed to be activated for the same group node when the path "course/course-1/resources" is used, and the second is supposed to be activated when the path is simply "course/course-1". At the moment only the second variant is being activated. When the path "course/course-1/resources" path is used it just shows the Course 1 group node in it's default layout with no panels being used.