Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created June 10, 2013 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5745928 to your computer and use it in GitHub Desktop.
Save anonymous/5745928 to your computer and use it in GitHub Desktop.
CTools Style Plugin Array Example
<?php
/**
* Defines a style plugin
*
* - custompanestyles: corresponds to directory name of plugin
* - render pane: postfix to pane theme function, i.e. theme_custompanestyles_render_pane.
* - render region: postfix to region theme function, i.e. theme_custompanestyles_render_region.
* - pane settings form: name of function that returns a settings form
* - hook theme: array of hook theme information
* - custompanestyles_theme_pane': corresponds to render pane value above
* - template: corresponds to name of tpl.php for pane, i.e. custompanestyles-pane.tpl.php
* - path: the path where the template file lives
* - variables: an array of variables to add to the $variables array in the theme function
*
*/
$plugin = array(
'custompanestyles' => array(
'title' => t('My Custom Pane Styles'),
'description' => t('Simple styles that highlight sections of your page.'),
'render pane' => 'custompanestyles_render_pane',
'render region' => 'custompanestyles_render_region',
'pane settings form' => 'custompanestyles_settings_form',
'hook theme' => array(
'custompanestyles_theme_pane' => array(
'template' => 'custompanestyles-pane',
'path' => drupal_get_path('module', 'name_of_module') .'/plugins/styles/custompanestyles',
'variables' => array(
'content' => NULL,
'settings' => NULL,
),
),
'custompanestyles_theme_region' => array(
'template' => 'custompanestyles-region',
'path' => drupal_get_path('module', 'name_of_module') .'/plugins/styles/custompanestyles',
'variables' => array(
'content' => NULL,
),
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment