outside_in_contextual_links_view_alter(&$element, $items)
Implements hook_contextual_links_view_alter().
Change Configure Blocks into offcanvas links.
File
- core/modules/outside_in/outside_in.module, line 35
- Allows configuring blocks and other configuration from the site front-end.
Code
1 2 3 4 5 6 7 8 9 10 11 12 | function outside_in_contextual_links_view_alter(& $element , $items ) { if (isset( $element [ '#links' ][ 'outside-inblock-configure' ])) { $element [ '#links' ][ 'outside-inblock-configure' ][ 'attributes' ] = [ 'class' => [ 'use-ajax' ], 'data-dialog-type' => 'dialog' , 'data-dialog-renderer' => 'offcanvas' , 'data-outside-in-edit' => TRUE, ]; $element [ '#attached' ][ 'library' ][] = 'outside_in/drupal.off_canvas' ; } } |
Please login to continue.