fieldable panels panes: add viewmode class to the pane

Public

add following to template.php:

</> CopyGet raw version
php
  1. /**
  2.  * implements hook_preprocess_panels_pane
  3.  */
  4. function hook_preprocess_panels_pane(&$variables) {
  5. // check if pane type is fieldable panels pane
  6. // check if a view mode is set
  7. if ($variables['pane']->type === "fieldable_panels_pane" && isset($variables['content']['#view_mode'])) {
  8. // add extra class to panel, related to the view mode
  9. $variables['classes_array'][] = 'view-mode-' . $variables['content']['#view_mode'];
  10. }
  11. }