<?php

/**
 * @file
 * {{ plugin_name }} content type plugin.
 */

/**
 * Plugin definition.
 */
$plugin = array(
  'single' => TRUE,
  'title' => t('{{ plugin_name }}'),
  'description' => t('{{ description }}'),
{% if context == 'Node' or context == 'User' %}
  'required context' => new ctools_context_required(t('{{ context }}'), '{{ context|lower }}'),
{% elseif context == 'Term' %}
  'required context' => new ctools_context_required(t('{{ context }}'), array('term', 'taxonomy_term')),
{% endif %}
  'category' => t('{{ category }}'),
  'render callback' => '{{ machine_name }}_{{ plugin_machine_name }}_content_type_render',
);

/**
 * Render callback.
 */
function {{ machine_name }}_{{ plugin_machine_name }}_content_type_render($subtype, $conf, $panel_args, $context) {
{% if context != '-' %}

  if (empty($context->data)) {
    return;
  }

{% endif %}
{% if context == 'Node' or context == 'Term' %}
  ${{ context|lower }} = clone $context->data;
{% elseif context == 'User' %}
{# Use $account variable to avoid confusion with the global $user object #}
  $account = clone $context->data;
{% endif %}

  // Build pane content.
  $build = array(
    '#markup' => 'Content placeholder.',
  );

  $block = new stdClass();
  $block->module = '{{ machine_name }}';
  $block->title = t('Title placeholder');
  $block->content = $build;
  return $block;
}
