I have a ctools content type plugin. It has a simple text field settings form. In there I am putting a token from the panel content e.g. %vn_subject:vn-subject-facebook-link. I am then rendering this into a template. However, it is just rendering out the token as above without processing it. How can I process the token if possible to retrieve the required field value? Thanks

1 Answer 1


The magic function is ctools_context_keyword_substitute

The key to getting this working is to make sure that you use the all contexts flag in your plugin configuration.

$plugin = array(
  'single' => TRUE,
  'title' => t('Instagram'),
  'category' => t('Content'),
  'all contexts' => TRUE,

 * Render the custom content type.
function MODULE_PANE_content_type_render($subtype, $conf, $panel_args, $context) {


  $replaced = ctools_context_keyword_substitute('your_string_with_%keywords', array(), $context);

  • Hi, thanks @Letharion. I have that function and trying to implement but having some issues. What is $keywords? What format does $contexts have to be in. and what $converter_options are availables :) Aug 15, 2013 at 13:56

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.