Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Manually rendering ctools-content-type
<?
ctools_include('plugins');
ctools_include('context');
ctools_include('content');
$plugin_id = 'super_pane';
$plugin = ctools_get_plugins('ctools','content_types', $this->options['field'], $plugin_id);
$conf = array() // array of configuration to pass to the content-type
$entity = node_load(1) // Create a context, if required
$context_id = 'node'; // As defined by the content-type plugun
if ($entity) {
$entity_context = ctools_context_create($context_id, $entity);
$entity_context->identifier = t('This @id', array('@id' => $context_id));
$entity_context->keyword = $context_id;
$context = array($context_id => $entity_context);
$conf['context'] = $context_id;
$ctools_content = ctools_content_render($plugin_id, $plugin_id, $conf, array(), array(), $context);
}
else {
$context = array();
$ctools_content = ctools_content_render($plugin_id, $plugin_id, $conf);
}
return $ctools_content->content;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment