Skip to content

Commit

Permalink
Merge pull request #612 from chapter-three/deployment/20211215
Browse files Browse the repository at this point in the history
Deployment/20211215
  • Loading branch information
melwong-jcc authored Dec 15, 2021
2 parents 1faacc7 + bd726ff commit f65b2ba
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 6 deletions.
1 change: 1 addition & 0 deletions config/config-default/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions config/config-default/search.page.node_search.yml
Original file line number Diff line number Diff line change
@@ -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: { }
14 changes: 14 additions & 0 deletions config/config-default/search.page.user_search.yml
Original file line number Diff line number Diff line change
@@ -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: { }
22 changes: 22 additions & 0 deletions config/config-default/search.settings.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 8 additions & 4 deletions web/themes/custom/atrium/includes/node.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions web/themes/custom/atrium/includes/page.inc
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ 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 = '';

$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;

Expand Down

0 comments on commit f65b2ba

Please sign in to comment.