diff --git a/uw_ct_service.module b/uw_ct_service.module index c90240806ee60d093c178a2d4e27b5800b159951..6baa7b493cb91d91992350f69c0b6aff74da1bce 100644 --- a/uw_ct_service.module +++ b/uw_ct_service.module @@ -135,7 +135,7 @@ function uw_ct_service_preprocess_views_view(&$variables) $services_ids = [ 'services_page', 'popular_services_page', - 'service_for_audience_page', + 'services_by_audience_page', 'services_in_category_page', 'all_services_page', ]; @@ -164,49 +164,18 @@ function uw_ct_service_preprocess_views_view(&$variables) ]; $content_list[] = [ - 'url' => '/services/audience/' . end($current_path_parts), + 'url' => '/services/audience', 'text' => 'Audience', '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; } - - // 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; - } }