Skip to content

Commit

Permalink
Merge branch '2.x' into feature/CHEMH-89--style-event-node
Browse files Browse the repository at this point in the history
  • Loading branch information
jdwjdwjdw authored Aug 16, 2023
2 parents d1cf54a + 9f34bde commit 1c96656
Show file tree
Hide file tree
Showing 74 changed files with 376 additions and 2,978 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ node_modules
.DS_Store
*.log
*.sql
dist/templates/decanter
2 changes: 1 addition & 1 deletion chem_h_subtheme.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ allpages:
theme:
dist/css/chem_h_subtheme.css: { minified: true }
js:
dist/js/scripts.js: { scope: footer }
src/js/chem_h_subtheme.behaviors.js: { }

fontawesome:
version: 5.15.4
Expand Down
38 changes: 38 additions & 0 deletions chem_h_subtheme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,41 @@ function chem_h_subtheme_preprocess_banner(&$variables) {
$variables['attributes']['class'][] = $paragraph->getBehaviorSetting('react_paragraphs:banner_variant_info', 'banner_style', 'chemh-wrapper--banner-default');
}

/**
* Implements hook_preprocess_HOOK().
*/
function chem_h_subtheme_preprocess_field__node__title__stanford_person(&$variables) {
/** @var \Drupal\node\NodeInterface $node */
$node = $variables['element']['#object'];
$type_terms = [];
$term_storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term');
if ($node->hasField('su_person_type_group') && !$node->get('su_person_type_group')
->isEmpty()) {
/** @var \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $field_item */
foreach ($node->get('su_person_type_group') as $field_item) {
try {
$term_id = $field_item->get('target_id')->getString();
$type_terms[] = $term_storage->load($term_id)->label();
}
catch (\Throwable $e) {
continue;
}
}
}
$terms_to_display = 1;

if ($type_terms && $variables['items'][0]['content']['#tag'] == 'h1') {
$variables['items'][0]['content']['#attributes']['class'][] = 'order-last';
$variables['items'][0]['content'] = [
'title' => $variables['items'][0]['content'],
'type' => [
'#type' => 'html_tag',
'#tag' => 'div',
'#attributes' => [
'class' => ['chem-h-person-type', 'order-first'],
],
'#value' => implode(', ', array_slice($type_terms, 0, $terms_to_display)),
],
];
}
}
2 changes: 1 addition & 1 deletion dist/css/chem_h_subtheme.css

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/js/scripts.js

This file was deleted.

39 changes: 0 additions & 39 deletions dist/templates/decanter/components/accordion/accordion.twig

This file was deleted.

72 changes: 0 additions & 72 deletions dist/templates/decanter/components/alert/alert.twig

This file was deleted.

25 changes: 0 additions & 25 deletions dist/templates/decanter/components/brand-bar/brand-bar.twig

This file was deleted.

19 changes: 0 additions & 19 deletions dist/templates/decanter/components/button/button.twig

This file was deleted.

Loading

0 comments on commit 1c96656

Please sign in to comment.