Skip to content
Snippets Groups Projects
Commit 1636ddab authored by Daniel Cothran's avatar Daniel Cothran
Browse files

Issue #3467714 by andileco, nikathone: Make the ID more specific in order to...

Issue #3467714 by andileco, nikathone: Make the ID more specific in order to allow module instances of the same view on the same page
parent 64073a1d
No related branches found
No related tags found
1 merge request!5Update 3 files
......@@ -23,8 +23,7 @@ function views_attachment_tabs_bootstrap_preprocess_views_view_attachment_tabs(a
$variables['tab_navigations_attributes']['class'][] = 'mb-3';
$variables['tab_panels_attributes']['class'][] = 'tab-content';
foreach ($variables['tab_navigations'] as $index => &$tab_navigation) {
$display_id = $tab_navigation['display_id'];
$id = 'views-view-' . $view_id . '--' . $display_id;
$id = $tab_navigation['unique_id'];
$panel_id = Html::getId($id . '--tab-panel--' . $index);
$tab_id = Html::getId($id . '--tab-nav--' . $index);
......
......@@ -29,8 +29,7 @@ function views_attachment_tabs_olivero_preprocess_views_view_attachment_tabs(arr
$variables['tab_navigations_attributes']['class'][] = 'tabs';
$variables['tab_navigations_attributes']['class'][] = 'tabs--primary';
foreach ($variables['tab_navigations'] as $index => &$tab_navigation) {
$display_id = $tab_navigation['display_id'];
$id = 'views-view-' . $view_id . '--' . $display_id;
$id = $tab_navigation['unique_id'];
$tab_id = Html::getId($id . '--tab-nav--' . $index);
$panel_id = Html::getId($id . '--tab-panel--' . $index);
......
......@@ -146,6 +146,7 @@ function views_attachment_tabs_preprocess_views_view_attachment_tabs(&$variables
$is_main_view = !empty($tab['is_main_view']);
$variables['tab_navigations'][] = [
'display_id' => $display_id,
'unique_id' => Html::getUniqueId('views-view-' . $view_id . '--' . $display_id),
'is_main_view' => $is_main_view,
'is_first_tab' => $tabs_counter === 1,
'wrapper_attributes' => new Attribute(['class' => []]),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment