5 * {{ plugin_name }} relationship plugin.
12 'title' => t('{{ plugin_name }}'),
13 'description' => t('{{ description }}'),
14 {% if context == 'Node' or context == 'User' %}
15 'required context' => new ctools_context_required(t('{{ context }}'), '{{ context | lower }}'),
16 {% elseif context == 'Term' %}
17 'required context' => new ctools_context_required(t('{{ context }}'), array('term', 'taxonomy_term')),
19 'context' => '{{ machine_name }}_{{ plugin_machine_name }}_context',
23 * Returns a new context based on an existing context.
25 function {{ machine_name }}_{{ plugin_machine_name }}_context($context, $conf) {
27 // @TODO: Replace "node" with identifier of the context
28 // this plugin is meant to provide.
29 if (empty($context->data)) {
30 return ctools_context_create_empty('node', NULL);
33 {% if context == 'Node' or context == 'Term' %}
34 ${{ context | lower }} = clone $context->data;
36 {% elseif context == 'User' %}
37 {# Use $account variable avoid confusion with the global $user object #}
38 $account = clone $context->data;
41 // @TODO: Replace this code with your own.
42 $related_node = node_load(1);
43 return ctools_context_create('node', $related_node);