Add class to reusable panels pane

Public

Content editor needs to be aware that they are editing reusable content. So add class to that panels pane, and style it differently.

Get raw version
php
  1. /**
  2.  * Implements template_preprocess_panels_pane().
  3.  */
  4. function MYTHEME_preprocess_panels_pane(&$variables) {
  5. if (isset($variables['pane'])) {
  6. $pane_type = $variables['pane']->type;
  7.  
  8. // Add .pane-reusable class to reusable pane.
  9. if (user_is_logged_in()) {
  10. if (isset($variables['pane']->configuration[$pane_type])) {
  11. if ($variables['pane']->configuration[$pane_type]->reusable == 1) {
  12. $variables['classes_array'][] = 'pane-reusable';
  13. }
  14. }
  15. }
  16.  
  17. }
  18. }