Skip to content

Commit

Permalink
Merge pull request #158 from yalesites-org/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
nJim authored Jul 31, 2023
2 parents a867298 + 434a359 commit e1f182f
Show file tree
Hide file tree
Showing 14 changed files with 445 additions and 88 deletions.
1 change: 1 addition & 0 deletions atomic.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ global:
node_modules/@yalesites-org/component-library-twig/dist/style.css: {}
components/_settings/_config.css: {}
css/admin-theme.css: {}
css/ckeditor-overrides.css: {}
js:
node_modules/@yalesites-org/component-library-twig/dist/js/02-molecules/menu/menu-toggle/yds-menu-toggle.js: {}
node_modules/@yalesites-org/component-library-twig/dist/js/00-tokens/layout/yds-layout.js: {}
Expand Down
14 changes: 14 additions & 0 deletions atomic.theme
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,17 @@ function atomic_preprocess_node(&$variables) {
$variables['date_formatted'] = \Drupal::service('date.formatter')->format($date, '', 'c');
}
}

/**
* Implements hook_preprocess_paragraph__accordion_item().
*
* Inject the heading_level based on the parent's heading presence.
*/
function atomic_preprocess_paragraph__accordion_item(&$variables) {
if ($accordion = $variables['paragraph']->getParentEntity()) {
if ($accordion->hasField('field_heading')) {
$heading = $accordion->field_heading->value;
$variables['attributes']['heading_level'] = empty($heading) ? 2 : 3;
}
}
}
Loading

0 comments on commit e1f182f

Please sign in to comment.