function entityqueue_contextual_links_view_alter in Entityqueue 8
Same name and namespace in other branches
- 7 entityqueue.module \entityqueue_contextual_links_view_alter()
Implements hook_contextual_links_view_alter().
Change Entityqueue on views into offcanvas links if available.
File
- ./
entityqueue.module, line 74 - Allows users to collect entities in arbitrarily ordered lists.
Code
function entityqueue_contextual_links_view_alter(&$element, $items) {
if (\Drupal::moduleHandler()
->moduleExists('settings_tray') && isset($element['#links']['entityentity-subqueueedit-form'])) {
$element['#links']['entityentity-subqueueedit-form']['attributes'] = [
'class' => [
'use-ajax',
],
'data-dialog-type' => 'dialog',
'data-dialog-renderer' => 'off_canvas',
'data-settings-tray-edit' => TRUE,
];
}
}