diff --git a/config/config-default/core.extension.yml b/config/config-default/core.extension.yml index 62b06375..b31b62d6 100644 --- a/config/config-default/core.extension.yml +++ b/config/config-default/core.extension.yml @@ -124,6 +124,7 @@ module: role_delegation: 0 scheduler: 0 scheduler_content_moderation_integration: 0 + search: 0 search_api: 0 search_api_db: 0 search_api_solr: 0 diff --git a/config/config-default/search.page.node_search.yml b/config/config-default/search.page.node_search.yml new file mode 100644 index 00000000..d8c51d1f --- /dev/null +++ b/config/config-default/search.page.node_search.yml @@ -0,0 +1,15 @@ +uuid: b4b1acd4-6a8c-4543-81f2-fdfdc9b39e73 +langcode: en +status: true +dependencies: + module: + - node +_core: + default_config_hash: 97tvtzGOa8_flb22CzSjgtm_YkiGMHvEBO-6q2K9V_U +id: node_search +label: Content +path: node +weight: -10 +plugin: node_search +configuration: + rankings: { } diff --git a/config/config-default/search.page.user_search.yml b/config/config-default/search.page.user_search.yml new file mode 100644 index 00000000..53e14623 --- /dev/null +++ b/config/config-default/search.page.user_search.yml @@ -0,0 +1,14 @@ +uuid: a6b4b62e-a0f3-4e35-9fca-e4c44276093a +langcode: en +status: true +dependencies: + module: + - user +_core: + default_config_hash: k3aUaZXGDuhkek2TZIee0PApOPTvYZLadziekdyHA5A +id: user_search +label: Users +path: user +weight: 0 +plugin: user_search +configuration: { } diff --git a/config/config-default/search.settings.yml b/config/config-default/search.settings.yml new file mode 100644 index 00000000..52301dd9 --- /dev/null +++ b/config/config-default/search.settings.yml @@ -0,0 +1,22 @@ +and_or_limit: 7 +default_page: node_search +index: + cron_limit: 100 + overlap_cjk: true + minimum_word_size: 3 + tag_weights: + h1: 25 + h2: 18 + h3: 15 + h4: 14 + h5: 9 + h6: 6 + u: 3 + b: 3 + i: 3 + strong: 3 + em: 3 + a: 10 +logging: false +_core: + default_config_hash: hvVxL1G-ZCxaq32IZws0YsfuhvaDiQE_np-0g35KjUk diff --git a/web/themes/custom/atrium/includes/node.inc b/web/themes/custom/atrium/includes/node.inc index 13563fff..034782f6 100644 --- a/web/themes/custom/atrium/includes/node.inc +++ b/web/themes/custom/atrium/includes/node.inc @@ -21,17 +21,21 @@ function atrium_preprocess_node(&$variables) { if (!$node->get('field_case_type_override')->isEmpty()) { $case_type_override = $node->get('field_case_type_override'); $variables['case_index']['url'] = Url::fromUri($case_type_override[0]->get('uri')->getValue()); - $variables['case_index']['label'] = t('Index: All ') . $case_type_override[0]->get('title')->getValue() . t(' Pages'); + $variables['case_index']['label'] = t('Index: All ') . t($case_type_override[0]->get('title')->getValue()) . t(' Pages'); } else { $terms = $node->get('field_case_types')->referencedEntities(); if(count($terms) == 1){ if (!$terms[0]->get('field_url')->isEmpty()) { $term_custom_uri = $terms[0]->get('field_url')->getValue(); $variables['case_index']['url'] = Url::fromUri($term_custom_uri[0]['uri']); - if ($term_custom_uri[0]['title'] != ''){ - $variables['case_index']['label'] = t('Index: All ') . $term_custom_uri[0]['title'] . t(' Pages'); + if ($term_custom_uri[0]['title'] != '') { + $variables['case_index']['label'] = t('Index: All ') . t($term_custom_uri[0]['title']) . t(' Pages'); } else { - $variables['case_index']['label'] = t('Index: All ') . $terms[0]->label() . t(' Pages'); + // Translation through taxonomy management. + $lang_code = \Drupal::languageManager()->getCurrentLanguage()->getId(); + $term_translated = Drupal::service('entity.repository')->getTranslationFromContext($terms[0], $lang_code); + $term_name = $term_translated->getName(); + $variables['case_index']['label'] = t('Index: All ') . $term_name . t(' Pages'); } } else { break; diff --git a/web/themes/custom/atrium/includes/page.inc b/web/themes/custom/atrium/includes/page.inc index 87baac1b..03c17e11 100644 --- a/web/themes/custom/atrium/includes/page.inc +++ b/web/themes/custom/atrium/includes/page.inc @@ -184,7 +184,8 @@ function _atrium_translation_menu() { ? str_replace("/$langcode", '', $current_path) : $current_path; } - // Create links for dropbutton component. + // Create links for dropbutton component if translated content exists for page. + $links = []; foreach ($languages as $langcode => $language) { $translated_path = ''; $current_id = ''; @@ -192,7 +193,6 @@ function _atrium_translation_menu() { $node = \Drupal::routeMatch()->getParameter('node'); if ($node instanceof \Drupal\node\NodeInterface) { // You can get nid and anything else you need from the node object. - $nid = $node->id(); $translated_path = \Drupal::service('path_alias.manager')->getAliasByPath('/node/'. $node->id(), $langcode); $prefixed_translated_path = '/' . $langcode . $translated_path;