Closed (won't fix)
Project:
Panels
Version:
6.x-3.0-rc1
Component:
Display rendering
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2009 at 19:42 UTC
Updated:
2 Dec 2009 at 13:55 UTC
I have spent several hours digging into the panels and ctools code trying to figure how to accomplish this on the panels side of things to no avail.
In a nutshell I need to be able to have a node page use the variant of its parent node as defined by the menu tree.
so basically
if (this_variant == my_node's_parent_menu_item_variant) return true;
Comments
Comment #1
merlinofchaos commentedYou're going to have to use the PHP Code selection rule and write code to do that. I don't know how to write that code, unfortunately.
Comment #2
stefan freudenberg commentedIs it currently possible to create plugins for that? I have a completely different use case but I wonder if there's a way to handle that logic in a plugin rather than putting code into the database.
Comment #3
cangeceiro commentedyes it is, i ended up implementing my scenario this way. look in the ctools folder for example plugins.
Comment #4
briandorval2 commentedAnyone have any example how to use the Code PHP in the Selection Rules, I need to get the userid (uid) and the nodeid (nid).
We probably can get it from the $contexts but I can't find it.
Thanks in advance.
Comment #5
briandorval2 commentedThat's OK, I found a way to did it:
global $user;
$node = node_load((arg(0) == 'node' && is_numeric(arg(1)))?arg(1):FALSE);