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
1 2 3 4 5 6 7 8 9 | 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' ; } } |
Please login to continue.