How to use $contexts in Page Manager Im trying to make a selection rule for variants in Page manger and it includes some data comparison so it has to be in php. My field data is inside the context, so the $contexts variable can be used, but I cant get the proper way to use it. In my case it is a field value of the node, that is specified by the argument in URL "node/%nid".

Can some body please give an example code to extract the field value from context in php?
First of all, I want to point out that since this issue got closed in December, ctools got much better support for handling fields in access rules.

With that said, $contexts, have a data value, which is either an object, or an array of objects, depending on whether your plugin requires one or more contexts.

To make the code easier to read, I usually do something like this: $node = $context-&gt;data;

Brief example code:

function contact_info_pane_content_type_render($subtype, $conf, $args, $context = NULL) {
  $block = new stdClass;
  $block-&gt;content = '';
  $node = $context-&gt;data;
  $block-&gt;content .= count($node-&gt;field_email) &gt; 0) ? $node-&gt;field_event_mail['und'][0]['email'] : '';
  $block-&gt;content .= count($node-&gt;field_phonenumber) &gt; 0) ? $node-&gt;field_event_phonenumber['und'][0]['safe_value'] : '';

  return $block;
}