Posted by ntigh52 on January 13, 2013 at 4:09pm
1 follower
Jump to:
| Project: | Panels |
| Version: | 7.x-3.3 |
| Component: | Panel nodes |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hi,
what is the right way to create variant just for 1 specific book?
node type == book && ?!?!
I can see in the context book parent page but I cant understand how to declare it?!
thanks.
Comments
#1
The rule need to be:
if (%book_parent:nid == blabla ){return true;
}
if (BOOK OUTLINE == %book_parent:title ){return true;
}
if (%book_parent:url == ?!? ){return true;
}
but I can not do this!
Does anyone have an idea?
Thnaks a lot.
#2
#3
I solve that like with the php code on rules in the variant:
$node = node_load(arg(1));if (isset($node->book['bid']) && $node->book['bid'] == '300' ) { // the nid of the book parent )
return true;
}
and its work!
but, I think there is another very simple way to do that with context and rules in panels....
how can i use the relations or context Instead of Php Knowledge,
Does anyone have an idea?
Thnaks a lot.
#4
#5
I found that if I add a context so I get all the $context variable.
if i add book parent context I get also:
Keyword: %book_parent%book_parent:nid --> Content ID
more more more ....
but How can I use this $context variable in php code in Variants » Selection rules ?!
Instead of using:
$node = node_load(arg(1));if (isset($node->book['bid']) && $node->book['bid'] == '300' ) { // the nid of the book parent )
return true;
}
to user the variable $context like:
if (isset(%book_parent:nid) && %book_parent:nid == '300' ) { // the nid of the book parent )return true;
}
can I use this %book_parent:nid ( from context ) in Variants » Selection rules ?!
Thanks