Skip to content
Snippets Groups Projects
Commit 25446292 authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-5129: trying to fix tabs for services

parent 1c3cb711
No related branches found
No related tags found
4 merge requests!60ISTWCMS-6095 Update maxlength settings for title, text fields and link fields...,!25ISTWCMS-5779 Click update button under...,!8Feature/istwcms 5127 ebremner services blocks gui,!7Feature/istwcms 5129 ebremner theme services views
...@@ -135,7 +135,7 @@ function uw_ct_service_preprocess_views_view(&$variables) ...@@ -135,7 +135,7 @@ function uw_ct_service_preprocess_views_view(&$variables)
$services_ids = [ $services_ids = [
'services_page', 'services_page',
'popular_services_page', 'popular_services_page',
'service_for_audience_page', 'services_by_audience_page',
'services_in_category_page', 'services_in_category_page',
'all_services_page', 'all_services_page',
]; ];
...@@ -164,49 +164,18 @@ function uw_ct_service_preprocess_views_view(&$variables) ...@@ -164,49 +164,18 @@ function uw_ct_service_preprocess_views_view(&$variables)
]; ];
$content_list[] = [ $content_list[] = [
'url' => '/services/audience/' . end($current_path_parts), 'url' => '/services/audience',
'text' => 'Audience', 'text' => 'Audience',
'active' => strpos($current_path, '/services/audience/') !== false ? 1 : 0, 'active' => strpos($current_path, '/services/audience/') !== false ? 1 : 0,
]; ];
$test = ''; $content_list[] = [
'url' => '/services/popular',
'text' => 'Audience',
'active' => strpos($current_path, '/services/audience/') !== false ? 1 : 0,
];
} }
$variables['content_list'] = $content_list; $variables['content_list'] = $content_list;
} }
// If we are on a service view that needs the tab
// links, then process the tabs links.
if ($id == 'uw_view_service_show_nodes' || $id == 'uw_view_service_show_terms') {
// // Taxonomy term id from views argument.
// $term_id = reset($variables['view']->args);
//
// // Building path from route for taxonomy term.
// // If there is an alias it will be used.
// $path = Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $term_id])->toString();
//
// // Get the current path and put into array based on
// // the slashes.
// $current_path = explode('/', \Drupal::service('path.current')->getPath());
//
// // Get the taxonomy term.
// $term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($term_id);
//
// // Get the tabs to be displayed.
// $tabs = $term->field_uw_catalog_tabs_display->getValue();
//
// // Only show the A-Z tab if there are other tabs.
// $content_list = [];
// if ($tabs) {
// // Setup the variable for the content list to be passed
// // to pattern-lab.
// $content_list[] = [
// 'url' => $path,
// 'text' => 'A-Z',
// 'active' => end($current_path) == $term_id ? 1 : 0,
// ];
// }
//
// $variables['content_list'] = $content_list;
}
} }
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