outside_in_preprocess_block

outside_in_preprocess_block(&$variables)

Implements hook_preprocess_HOOK() for block templates.

File

core/modules/outside_in/outside_in.module, line 93
Allows configuring blocks and other configuration from the site front-end.

Code

function outside_in_preprocess_block(&$variables) {
  // The main system block does not contain the block contextual links.
  $variables['#cache']['contexts'][] = 'outside_in_is_applied';
  if ($variables['plugin_id'] !== 'system_main_block' && \Drupal::service('outside_in.manager')->isApplicable()) {
    // Add class and attributes to all blocks to allow Javascript to target.
    $variables['attributes']['class'][] = 'outside-in-editable';
    $variables['attributes']['data-drupal-outsidein'] = 'editable';
  }
}
doc_Drupal
2016-10-29 09:32:44
Comments
Leave a Comment

Please login to continue.