')->toString()) {
+ array_pop($links);
+ }
+
+ // Per https://forumone.atlassian.net/browse/EPAD8-2411 we want to limit the
+ // breadcrumbs to a max of 5 (Home -> Web Area Homepage -> Parent -> Child -> Grand Child)
+ if (count($links) > 5) {
+ array_splice($links, 5);
+ }
+
+ return $breadcrumb->setLinks($links);
+ }
+
+ /**
+ * The getter function for $menuName property.
+ *
+ * @return string
+ * The menu name.
+ */
+ public function getMenuName() {
+ return $this->menuName;
+ }
+
+ /**
+ * The setter function for $menuName property.
+ *
+ * @param string $menu_name
+ * The menu name.
+ */
+ public function setMenuName($menu_name) {
+ $this->menuName = $menu_name;
+ }
+
+ /**
+ * The getter function for $menuTrail property.
+ *
+ * @return string
+ * The menu trail.
+ */
+ public function getMenuTrail() {
+ return $this->menuTrail;
+ }
+
+ /**
+ * The setter function for $menuTrail property.
+ *
+ * @param string $menu_trail
+ * The menu trail.
+ */
+ public function setMenuTrail($menu_trail) {
+ $this->menuTrail = $menu_trail;
+ }
+
+ /**
+ * The getter function for $contentLanguage property.
+ *
+ * @return string
+ * The content language.
+ */
+ public function getContentLanguage() {
+ return $this->contentLanguage;
+ }
+
+ /**
+ * The setter function for $contentLanguage property.
+ *
+ * @param string $contentLanguage
+ * The content language.
+ */
+ public function setContentLanguage($contentLanguage) {
+ $this->contentLanguage = $contentLanguage;
+ }
+
+}
diff --git a/services/drupal/web/modules/custom/epa_core/epa_core.services.yml b/services/drupal/web/modules/custom/epa_core/epa_core.services.yml
index bc399bf83c..964085446d 100644
--- a/services/drupal/web/modules/custom/epa_core/epa_core.services.yml
+++ b/services/drupal/web/modules/custom/epa_core/epa_core.services.yml
@@ -11,6 +11,15 @@ services:
arguments: ['@config.factory']
tags:
- { name: event_subscriber }
+ epa_core.route_subscriber:
+ class: Drupal\epa_core\Routing\RouteSubscriber
+ tags:
+ - { name: event_subscriber }
+ epa_core.webform_access_check:
+ class: Drupal\epa_core\Access\EpaWebformAccessCheck
+ arguments: ['@group.membership_loader', '@entity_type.manager']
+ tags:
+ - { name: access_check, applies_to: _epa_webform_access_check }
entity.autocomplete_matcher:
class: Drupal\epa_core\Entity\EntityAutocompleteMatcher
arguments: [ '@plugin.manager.entity_reference_selection' ]
diff --git a/services/drupal/web/modules/custom/epa_core/src/Access/EpaWebformAccessCheck.php b/services/drupal/web/modules/custom/epa_core/src/Access/EpaWebformAccessCheck.php
new file mode 100644
index 0000000000..fa654b1075
--- /dev/null
+++ b/services/drupal/web/modules/custom/epa_core/src/Access/EpaWebformAccessCheck.php
@@ -0,0 +1,108 @@
+groupMembershipLoader = $group_membership_loader;
+ $this->entityTypeManager = $entity_type_manager;
+ }
+
+ public function access(RouteMatchInterface $route_match, AccountInterface $account) {
+ // Allow access if the user is an administrator or system_webmaster.
+ if ($account->hasRole('administrator') || $account->hasRole('system_webmaster')) {
+ return AccessResult::allowed();
+ }
+
+ // User must belong to a group if they don't have the above roles
+ $group_memberships = $this->groupMembershipLoader->loadByUser($account);
+
+ if (empty($group_memberships)) {
+ return AccessResultForbidden::forbidden('A user must belong to a group to view submissions.');
+ }
+
+ // Collect group IDs from user's memberships.
+ $group_ids = array_map(fn($membership) => $membership->getGroup()->id(), $group_memberships);
+
+ // Webforms themselves aren't tied to a Group, but they are referenced
+ // by a "Form" node. The "Form" node does belong to a Group.
+ // Given the Webform ID, search for a matching node that references the webform.
+ // If we find one, compare the node's group to see if the user belongs
+ // to same group.
+ /** @var \Drupal\webform\Entity\Webform $webform */
+ $webform = $route_match->getParameter("webform");
+ $webform_id = $webform->id();
+
+ // Add webform nodes ("form") have a "webform" field that contains the reference
+ // to the webform. Query to see if we can find the
+ $found = $this->entityTypeManager
+ ->getStorage('node')
+ ->getQuery()
+ ->accessCheck()
+ ->condition('webform', $webform_id)
+ ->execute();
+
+ // Every webform should be associated with a node. If not then don't proceed.
+ if (!$found) {
+ return AccessResult::forbidden();
+ }
+
+ $id = reset($found);
+
+ // Load the node and its group content.
+ $node = Node::load($id);
+ /** @var \Drupal\group\Entity\GroupContent $gc */
+ $gc = GroupContent::loadByEntity($node);
+
+ if (empty($gc)) {
+ return AccessResult::forbidden("Cannot view content that does not belong to a web area.");
+ }
+
+ $group_content = reset($gc);
+
+ if (!$group_content || !in_array($group_content->getGroup()->id(), $group_ids)) {
+ return AccessResultForbidden::forbidden('User does not belong to the same group as this webform.');
+ }
+
+ return AccessResult::allowed();
+ }
+
+}
diff --git a/services/drupal/web/modules/custom/epa_core/src/Routing/RouteSubscriber.php b/services/drupal/web/modules/custom/epa_core/src/Routing/RouteSubscriber.php
new file mode 100644
index 0000000000..98398187d8
--- /dev/null
+++ b/services/drupal/web/modules/custom/epa_core/src/Routing/RouteSubscriber.php
@@ -0,0 +1,20 @@
+get('entity.webform.results_submissions');
+ if ($route) {
+ $route->setRequirement('_epa_webform_access_check', TRUE);
+ }
+ }
+
+}
diff --git a/services/drupal/web/modules/custom/epa_web_areas/css/add-content-message.css b/services/drupal/web/modules/custom/epa_web_areas/css/add-content-message.css
new file mode 100644
index 0000000000..35b9d49901
--- /dev/null
+++ b/services/drupal/web/modules/custom/epa_web_areas/css/add-content-message.css
@@ -0,0 +1,3 @@
+.epa-web-areas-custom-message .messages__content {
+ margin-inline-start: 0;
+}
diff --git a/services/drupal/web/modules/custom/epa_web_areas/css/admin-group-node-add.css b/services/drupal/web/modules/custom/epa_web_areas/css/admin-group-node-add.css
new file mode 100644
index 0000000000..7994749b4d
--- /dev/null
+++ b/services/drupal/web/modules/custom/epa_web_areas/css/admin-group-node-add.css
@@ -0,0 +1 @@
+.admin-item__title, .admin-item__description { display: inline; }
diff --git a/services/drupal/web/modules/custom/epa_web_areas/epa_web_areas.libraries.yml b/services/drupal/web/modules/custom/epa_web_areas/epa_web_areas.libraries.yml
new file mode 100644
index 0000000000..4479fa3b94
--- /dev/null
+++ b/services/drupal/web/modules/custom/epa_web_areas/epa_web_areas.libraries.yml
@@ -0,0 +1,11 @@
+group_node.add:
+ version: VERSION
+ css:
+ theme:
+ css/admin-group-node-add.css: {}
+
+custom_message:
+ version: VERSION
+ css:
+ theme:
+ css/add-content-message.css: { }
diff --git a/services/drupal/web/modules/custom/epa_web_areas/epa_web_areas.module b/services/drupal/web/modules/custom/epa_web_areas/epa_web_areas.module
index cb79fcbdb6..3b3bab15f9 100644
--- a/services/drupal/web/modules/custom/epa_web_areas/epa_web_areas.module
+++ b/services/drupal/web/modules/custom/epa_web_areas/epa_web_areas.module
@@ -11,6 +11,7 @@ use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Render\Markup;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;
use Drupal\group\Entity\Group;
@@ -39,12 +40,6 @@ function epa_web_areas_form_node_form_alter(&$form, FormStateInterface $form_sta
$group = $form_state->getStorage()['group'];
}
- // Set access to hublinks for Web Area homepage.
- if (isset($form['field_hublinks'])) {
- $has_hublinks = !empty($group) ? \Drupal::service('epa_web_areas.web_areas_helper')->checkNavigationStyle($group) : FALSE;
- $form['field_hublinks']['#access'] = $has_hublinks;
- }
-
// Add group label to form.
if (!empty($group)) {
$form['group_info']['#markup'] = 'Web Area: ' . $group->toLink(NULL, 'canonical', ['attributes' => ['target' => '_blank']])->toString();
@@ -76,30 +71,6 @@ function epa_web_areas_form_group_web_area_edit_form_alter(&$form, FormStateInte
}
}
-/**
- * Implements hook_block_access().
- *
- * - Used to hide sidebar menu if content belongs to group using hublinks
- * as its naviagtion style.
- */
-function epa_web_areas_block_access(Block $block, $operation, AccountInterface $account) {
- if ($operation == 'view' && $block->getPluginId() == 'groupmenus') {
- $node = \Drupal::routeMatch()->getParameter('node');
- if ($node) {
- $group_contents = GroupContent::loadByEntity($node);
- foreach ($group_contents as $group_content) {
- $group = $group_content->getGroup();
- }
- }
- else {
- $group = \Drupal::routeMatch()->getParameter('group');
- }
- $has_hublinks = !empty($group) ? \Drupal::service('epa_web_areas.web_areas_helper')->checkNavigationStyle($group) : TRUE;
- return AccessResult::forbiddenIf($has_hublinks)->addCacheableDependency($block);
- }
- return AccessResult::neutral();
-}
-
/**
* Implements hook_entity_type_alter().
*/
@@ -202,6 +173,25 @@ function epa_web_areas_form_media_library_add_form_alter(&$form, FormStateInterf
* Implements hook_form_FORM_ID_alter().
*/
function epa_web_areas_form_embedded_paragraphs_paragraphs_entity_embed_form_alter(&$form, FormStateInterface $form_state, $form_id) {
+ // Add custom help text describing each paragraph item.
+ // @link https://forumone.atlassian.net/browse/EPAD8-2509
+ $items = [
+ Markup::create('Before/After Swipe : compare two images side-by-side'),
+ Markup::create('Boxes highlight specific web content. Each box style has specific content requirements'),
+ Markup::create('Dynamic Lists are automated lists of WebCMS content based on filters'),
+ Markup::create('From Library can be used to add "reusable paragraphs ," which can be embedded on multiple pages'),
+ 'Add Header adds headings like h2, h3, etc.',
+ Markup::create('Link List are bulleted lists of links'),
+ Markup::create('Slideshows are pictures that can be cycled through'),
+ ];
+
+ $help_text_list = [
+ '#theme' => 'item_list',
+ '#type' => 'ul',
+ '#items' => $items,
+ '#weight' => -100,
+ ];
+ $form['help_text'] = $help_text_list;
// Add a custom submit handler that runs after media is added and saved.
if (!empty($form['actions'])) {
$form['#submit'][] = 'epa_web_areas_group_media_submit';
@@ -396,29 +386,6 @@ function epa_web_areas_group_media_submit($form, FormStateInterface $form_state)
}
}
-/**
- * Implements hook_node_presave().
- */
-function epa_web_areas_node_presave(EntityInterface $entity) {
- if ($entity->hasField('field_hublinks') && $entity->id()) {
- $groups = \Drupal::service('epa_web_areas.web_areas_helper')
- ->getNodeReferencingGroups($entity);
- $hublinks = $entity->field_hublinks->getValue();
-
- foreach ($groups as $group) {
- $group_hublink = ['target_id' => $group->id()];
- $the_group = array_filter($hublinks, function ($item) use ($group_hublink) {
- return !empty($item['target_id']) && $item['target_id'] == $group_hublink['target_id'];
- });
- if (empty($the_group)) {
- array_unshift($hublinks, $group_hublink);
- }
- }
-
- $entity->field_hublinks->setValue($hublinks);
- }
-}
-
/**
* Alter local actions plugins.
*
@@ -506,17 +473,6 @@ function epa_web_areas_entity_access(EntityInterface $entity, $operation, Accoun
return group_entity_access($entity, $operation, $account);
}
-/**
- *
- */
-function epa_web_areas_preprocess_node(&$variables) {
- $groups = \Drupal::service('epa_web_areas.web_areas_helper')->getNodeReferencingGroups($variables['node']);
- $group = reset($groups);
- if ($group && $group->hasField('field_navigation_style')) {
- $variables['nav_style'] = $group->field_navigation_style->value;
- }
-}
-
/**
* Implements hook_views_data_alter().
*/
@@ -547,3 +503,32 @@ function epa_web_areas_views_data_alter(array &$data) {
$data["search_api_index_media"]["gid"]["filter"]['id'] = 'search_api_entity_reference';
}
}
+
+/**
+ * Implements hook_preprocess_HOOK() for the page variable.
+ *
+ * Adds custom status message to the below routes.
+ * @link https://forumone.atlassian.net/browse/EPAD8-2490
+ */
+function epa_web_areas_preprocess_page(&$variables) {
+ $routes = [
+ 'entity.group.canonical',
+ 'system.admin_content'
+ ];
+ if (in_array(\Drupal::routeMatch()->getRouteName(), $routes)) {
+ $message = Markup::create('Add new content or use these filters to find content that you are looking for . Type your User ID into the Author or the Last Updated By fields to find content you\'ve worked on.');
+ $variables['page']['highlighted']['#attached']['library'][] = 'epa_web_areas/custom_message';
+ $variables['page']['highlighted']['custom_message'] = [
+ '#theme' => 'status_messages',
+ '#attributes' => [
+ 'class' => ['epa-web-areas-custom-message'],
+ ],
+ '#message_list' => [
+ 'warning' => [$message]
+ ],
+ '#status_headings' => [
+ 'warning' => '',
+ ],
+ ];
+ }
+}
diff --git a/services/drupal/web/modules/custom/epa_web_areas/epa_web_areas.post_update.php b/services/drupal/web/modules/custom/epa_web_areas/epa_web_areas.post_update.php
new file mode 100644
index 0000000000..38b929c2f4
--- /dev/null
+++ b/services/drupal/web/modules/custom/epa_web_areas/epa_web_areas.post_update.php
@@ -0,0 +1,115 @@
+getStorage('group')
+ ->loadMultiple();
+
+ /** @var \Drupal\path_alias\AliasManager $path_manager */
+ $path_manager = \Drupal::service('path_alias.manager');
+
+ /** @var \Drupal\menu_link_content\MenuLinkContentStorageInterface $menu_link_storage */
+ $menu_link_storage = \Drupal::entityTypeManager()
+ ->getStorage('menu_link_content');
+
+ /** @var \Drupal\Core\Menu\MenuLinkTreeInterface $menu_tree */
+ $menu_tree = \Drupal::service('menu.link_tree');
+ $menu_parameters = new MenuTreeParameters();
+ $menu_parameters->setTopLevelOnly();
+
+ // This puts the menu tree in the right order.
+ $manipulators = [
+ ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],
+ ];
+
+ foreach ($groups as $group) {
+ // Now load any group menus based on that group. Should only be one, however
+ // there's no reason they can't have more than one.
+ $content_menus = group_content_menu_get_menus_per_group($group);
+
+ // Loop over each menu, load & build the menu tree, and look at the first item.
+ foreach ($content_menus as $menu) {
+ $menu_name = GroupContentMenuInterface::MENU_PREFIX . $menu->id();
+ $tree = $menu_tree->load($menu_name, $menu_parameters);
+
+ if (empty($tree)) {
+ \Drupal::logger('epa_web_areas_menu_cleanup')->notice("{$group->label()} ({$group->id()}) menu does not have any menu items.");
+ continue;
+ }
+
+ // This is what actually puts the menu tree in the order based on the UI.
+ $tree = $menu_tree->transform($tree, $manipulators);
+
+ /** @var \Drupal\Core\Menu\MenuLinkTreeElement $first */
+ if ($first = reset($tree)) {
+ // If it has children log and continue on. That will manually need to be cleaned up.
+ if ($first->hasChildren) {
+ \Drupal::logger('epa_web_areas_menu_cleanup')->notice("{$group->label()} ({$group->id()}) menu first link has children. Skipping.");
+ continue;
+ }
+
+ /** @var \Drupal\menu_link_content\Plugin\Menu\MenuLinkContent $first_link */
+ $first_link = $first->link;
+ /** @var \Drupal\Core\Url $first_link_url */
+ $first_link_url = $first_link->getUrlObject();
+ // The menu link could be external. If so, we need to get the actual path
+ if ($first_link_url->isExternal()) {
+ $parts = parse_url($first_link_url->toString());
+ if (str_contains($parts['host'], 'epa.gov') && isset($parts['path'])) {
+ // If it's an EPA link, we can just use the path.
+ $first_link_path = $parts['path'];
+ }
+ else {
+ \Drupal::logger('epa_web_areas_menu_cleanup')->notice("{$group->label()} ({$group->id()}) first menu link URL goes off domain");
+ continue;
+ }
+ }
+ else {
+ $first_link_path = $first_link_url->toString();
+ }
+
+ // Get the field_homepage node from the group to use for comparing urls.
+ $homepage = $group->get('field_homepage')->entity;
+ if (!$homepage) {
+ \Drupal::logger('epa_web_areas_menu_cleanup')->notice("{$group->label()} ({$group->id()}) does not have homepage set");
+ continue;
+ }
+ if (!$homepage->isPublished()) {
+ \Drupal::logger('epa_web_areas_menu_cleanup')->notice("{$group->label()} ({$group->id()}) homepage is not published");
+ continue;
+ }
+
+ $homepage_url_path = $homepage->toUrl()->toString();
+
+ if (str_starts_with($homepage_url_path, '/node/')) {
+ $homepage_url_path = $path_manager->getAliasByPath($homepage_url_path);
+ }
+
+ if (str_starts_with($first_link_path, '/node/')) {
+ $first_link_path = $path_manager->getAliasByPath($first_link_path);
+ }
+
+ // Compare if the group's field_homepage URL is going to the same place as
+ // the first menu link AND if it doesn't have any children.
+ if ($first_link_path == $homepage_url_path) {
+ // First link is the homepage link AND it has no children. Now load the
+ // actual menu link entity and set it to be disabled.
+ $plugin_definition = $first_link->getPluginDefinition();
+ $actual_menu_link = $menu_link_storage->load($plugin_definition['metadata']['entity_id']);
+ $actual_menu_link->set('enabled', FALSE)->save();
+ \Drupal::logger('epa_web_areas_menu_cleanup')->notice("Successfully disabled home link for {$group->label()} ({$group->id()}");
+ }
+ else {
+ \Drupal::logger('epa_web_areas_menu_cleanup')->notice("{$group->label()} ({$group->id()}) menu first link does not go to homepage: \n Links compared were: $first_link_path and $homepage_url_path");
+ }
+ }
+ }
+ }
+}
diff --git a/services/drupal/web/modules/custom/epa_web_areas/src/Controller/EpaWebAreasGroupNodeController.php b/services/drupal/web/modules/custom/epa_web_areas/src/Controller/EpaWebAreasGroupNodeController.php
new file mode 100644
index 0000000000..9f97f58700
--- /dev/null
+++ b/services/drupal/web/modules/custom/epa_web_areas/src/Controller/EpaWebAreasGroupNodeController.php
@@ -0,0 +1,120 @@
+pluginManager = $plugin_manager;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function create(ContainerInterface $container) {
+ return new static(
+ $container->get('plugin.manager.group_content_enabler'),
+ $container->get('tempstore.private'),
+ $container->get('entity_type.manager'),
+ $container->get('entity.form_builder'),
+ $container->get('renderer')
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function addPage(GroupInterface $group, $create_mode = FALSE) {
+ $build = parent::addPage($group, $create_mode);
+ // Custom css library for styling as we want it to look.
+ $build['#attached']['library'][] = 'epa_web_areas/group_node.add';
+
+ // Do not interfere with redirects.
+ if (!is_array($build)) {
+ return $build;
+ }
+
+ // Overwrite the label and description for all of the displayed bundles.
+ $storage_handler = $this->entityTypeManager->getStorage('node_type');
+ foreach ($this->addPageBundles($group, $create_mode) as $plugin_id => $bundle_name) {
+ if (!empty($build['#bundles'][$bundle_name])) {
+ $plugin = $group->getGroupType()->getContentPlugin($plugin_id);
+ $bundle_label = $storage_handler->load($plugin->getEntityBundle())->label();
+ $description = $storage_handler->load($plugin->getEntityBundle())->getDescription();
+
+ $build['#bundles'][$bundle_name]['label'] = $bundle_label;
+ $build['#bundles'][$bundle_name]['add_link']->setText($bundle_label);
+ $build['#bundles'][$bundle_name]['description'] = $description;
+ }
+ }
+
+ // Display the bundles in alpha order by label.
+ if (is_array($build['#bundles'])) {
+ uasort($build['#bundles'], function($a, $b) {
+ return strnatcmp($a['label'], $b['label']);
+ });
+ }
+
+ return $build;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function addPageBundles(GroupInterface $group, $create_mode) {
+ $bundles = [];
+
+ // Retrieve all group_node plugins for the group's type.
+ $plugin_ids = $this->pluginManager->getInstalledIds($group->getGroupType());
+ foreach ($plugin_ids as $key => $plugin_id) {
+ if (strpos($plugin_id, 'group_node:') !== 0) {
+ unset($plugin_ids[$key]);
+ }
+ }
+
+ // Retrieve all of the responsible group content types, keyed by plugin ID.
+ $storage = $this->entityTypeManager->getStorage('group_content_type');
+ $properties = ['group_type' => $group->bundle(), 'content_plugin' => $plugin_ids];
+ foreach ($storage->loadByProperties($properties) as $bundle => $group_content_type) {
+ /** @var \Drupal\group\Entity\GroupContentTypeInterface $group_content_type */
+ $bundles[$group_content_type->getContentPluginId()] = $bundle;
+ }
+
+ return $bundles;
+ }
+
+}
diff --git a/services/drupal/web/modules/custom/epa_web_areas/src/Plugin/Action/UpdateGroupAssociationBase.php b/services/drupal/web/modules/custom/epa_web_areas/src/Plugin/Action/UpdateGroupAssociationBase.php
index df7b025f18..dd32673f2c 100644
--- a/services/drupal/web/modules/custom/epa_web_areas/src/Plugin/Action/UpdateGroupAssociationBase.php
+++ b/services/drupal/web/modules/custom/epa_web_areas/src/Plugin/Action/UpdateGroupAssociationBase.php
@@ -16,6 +16,8 @@
use Drupal\group\Entity\GroupContent;
use Drupal\group\GroupMembershipLoaderInterface;
use Drupal\node\NodeInterface;
+use Drupal\search_api\Plugin\search_api\datasource\ContentEntityTrackingManager;
+use Drupal\search_api\Utility\TrackingHelper;
use Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -57,6 +59,20 @@ abstract class UpdateGroupAssociationBase extends ViewsBulkOperationsActionBase
*/
protected $targetGroup;
+ /**
+ * The Search API Tracking Helper service.
+ *
+ * @var \Drupal\search_api\Utility\TrackingHelper
+ */
+ protected $trackingHelper;
+
+ /**
+ * The Search API tracking manager service.
+ *
+ * @var \Drupal\search_api\Plugin\search_api\datasource\ContentEntityTrackingManager
+ */
+ protected $trackingManager;
+
const DENIED = 'access_denied';
const CONFIG_DENIED = 'config_denied';
@@ -79,6 +95,8 @@ public static function create(ContainerInterface $container, array $configuratio
$container->get('group.membership_loader'),
$container->get('config.factory'),
$container->get('messenger'),
+ $container->get('search_api.entity_datasource.tracking_manager'),
+ $container->get('search_api.tracking_helper')
);
}
@@ -88,12 +106,14 @@ public static function create(ContainerInterface $container, array $configuratio
* @param $plugin_definition
* @param \Drupal\Core\Session\AccountProxyInterface $current_user
*/
- public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountProxyInterface $current_user, GroupMembershipLoaderInterface $group_membership_loader, ConfigFactoryInterface $config_factory, MessengerInterface $messenger) {
+ public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountProxyInterface $current_user, GroupMembershipLoaderInterface $group_membership_loader, ConfigFactoryInterface $config_factory, MessengerInterface $messenger, ContentEntityTrackingManager $tracking_manager, TrackingHelper $tracking_helper) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->currentUser = $current_user;
$this->groupMembershipLoader = $group_membership_loader;
$this->configFactory = $config_factory;
$this->messenger = $messenger;
+ $this->trackingManager = $tracking_manager;
+ $this->trackingHelper = $tracking_helper;
}
/**
@@ -212,6 +232,13 @@ public function execute($entity = NULL) {
$group_content->save();
}
$title = $entity instanceof NodeInterface ? $entity->getTitle() : $entity->getName();
+
+ // Trigger an update on the entity's relevant search index.
+ $this->trackingManager->entityUpdate($entity);
+
+ // Update the tracking on any items that are referencing this entity.
+ $this->trackingHelper->trackReferencedEntityUpdate($entity);
+
return UpdateGroupAssociationBase::SUCCESS . "|$title|{$group_content->getGroup()->label()}";
}
else {
@@ -226,6 +253,13 @@ public function execute($entity = NULL) {
// Means it was never associated with a group
$group_content = GroupContent::create($values)->save();
$title = $entity instanceof NodeInterface ? $entity->getTitle() : $entity->getName();
+
+ // Trigger an update on the entity's relevant search index.
+ $this->trackingManager->entityUpdate($entity);
+
+ // Update the tracking on any items that are referencing this entity.
+ $this->trackingHelper->trackReferencedEntityUpdate($entity);
+
return UpdateGroupAssociationBase::SUCCESS . "|$title|{$group_content->getGroup()->label()}";
}
}
@@ -308,7 +342,15 @@ public static function finished($success, array $results, array $operations): ?R
$message = static::translate('Finished with an error.');
static::message($message, 'error');
}
- return NULL;
+
+ $batch = &batch_get();
+ // Return back to view where they came from, but remove all query params.
+ // This is to resolve an issue where items still appear under the wrong Web Area after they've been changed.
+ /** @var \Drupal\Core\Url $redirect_url */
+ $redirect_url = $batch['batch_redirect'];
+ $redirect_url->setOption('query', []);
+ $url = $batch['batch_redirect']->toString();
+ return new RedirectResponse($url);
}
/**
diff --git a/services/drupal/web/modules/custom/epa_web_areas/src/Routing/RouteSubscriber.php b/services/drupal/web/modules/custom/epa_web_areas/src/Routing/RouteSubscriber.php
index 9b36f4a9a5..c1507ed472 100644
--- a/services/drupal/web/modules/custom/epa_web_areas/src/Routing/RouteSubscriber.php
+++ b/services/drupal/web/modules/custom/epa_web_areas/src/Routing/RouteSubscriber.php
@@ -99,6 +99,11 @@ protected function alterRoutes(RouteCollection $collection) {
$route->addOptions(['_admin_route' => TRUE]);
}
}
+ // Need to alter the group node route to alter the output as we want.
+ // @link https://forumone.atlassian.net/browse/EPAD8-2489
+ if ($route = $collection->get('entity.group_content.group_node_add_page')) {
+ $route->setDefault('_controller', '\Drupal\epa_web_areas\Controller\EpaWebAreasGroupNodeController::addPage');
+ }
}
/**
diff --git a/services/drupal/web/modules/custom/epa_web_areas/src/Utility/WebAreasHelper.php b/services/drupal/web/modules/custom/epa_web_areas/src/Utility/WebAreasHelper.php
index 92be001235..a1cf0cf42d 100644
--- a/services/drupal/web/modules/custom/epa_web_areas/src/Utility/WebAreasHelper.php
+++ b/services/drupal/web/modules/custom/epa_web_areas/src/Utility/WebAreasHelper.php
@@ -21,22 +21,6 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager) {
$this->entityTypeManager = $entity_type_manager;
}
- /**
- * Function checking if web area has a navigation style.
- *
- * @param Drupal\group\Entity\Group $group
- * The $group enity.
- * @param string $style
- * The navigation style being tested.
- *
- * @return bool
- * Returns true if navigation style is selected for group.
- */
- public function checkNavigationStyle(Group $group, $style = 'hublinks') {
- $group_type = $group->getGroupType()->id();
- return $group_type == 'web_area' && $group->field_navigation_style->value == $style;
- }
-
/**
* Function to grab groups associated with node.
*
diff --git a/services/drupal/web/modules/custom/epa_wysiwyg/package-lock.json b/services/drupal/web/modules/custom/epa_wysiwyg/package-lock.json
index 0ea284a1e8..60d37127ec 100644
--- a/services/drupal/web/modules/custom/epa_wysiwyg/package-lock.json
+++ b/services/drupal/web/modules/custom/epa_wysiwyg/package-lock.json
@@ -19,7 +19,7 @@
"raw-loader": "^4.0.2",
"style-loader": "^3.3.2",
"terser-webpack-plugin": "^5.2.0",
- "webpack": "^5.76.0",
+ "webpack": "^5.94.0",
"webpack-cli": "^4.4.0"
}
},
@@ -1171,26 +1171,6 @@
"node": ">=10.13.0"
}
},
- "node_modules/@types/eslint": {
- "version": "8.4.10",
- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.10.tgz",
- "integrity": "sha512-Sl/HOqN8NKPmhWo2VBEPm0nvHnu2LL3v9vKo8MEq0EtbJ4eVzGPl41VNPvn5E1i5poMk4/XD8UriLHpJvEP/Nw==",
- "dev": true,
- "dependencies": {
- "@types/estree": "*",
- "@types/json-schema": "*"
- }
- },
- "node_modules/@types/eslint-scope": {
- "version": "3.7.4",
- "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz",
- "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==",
- "dev": true,
- "dependencies": {
- "@types/eslint": "*",
- "@types/estree": "*"
- }
- },
"node_modules/@types/estree": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
@@ -2212,9 +2192,9 @@
}
},
"node_modules/enhanced-resolve": {
- "version": "5.17.0",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz",
- "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==",
+ "version": "5.17.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz",
+ "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.4",
@@ -4858,12 +4838,11 @@
}
},
"node_modules/webpack": {
- "version": "5.92.1",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.92.1.tgz",
- "integrity": "sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==",
+ "version": "5.94.0",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz",
+ "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==",
"dev": true,
"dependencies": {
- "@types/eslint-scope": "^3.7.3",
"@types/estree": "^1.0.5",
"@webassemblyjs/ast": "^1.12.1",
"@webassemblyjs/wasm-edit": "^1.12.1",
@@ -4872,7 +4851,7 @@
"acorn-import-attributes": "^1.9.5",
"browserslist": "^4.21.10",
"chrome-trace-event": "^1.0.2",
- "enhanced-resolve": "^5.17.0",
+ "enhanced-resolve": "^5.17.1",
"es-module-lexer": "^1.2.1",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
@@ -5897,26 +5876,6 @@
"integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==",
"dev": true
},
- "@types/eslint": {
- "version": "8.4.10",
- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.10.tgz",
- "integrity": "sha512-Sl/HOqN8NKPmhWo2VBEPm0nvHnu2LL3v9vKo8MEq0EtbJ4eVzGPl41VNPvn5E1i5poMk4/XD8UriLHpJvEP/Nw==",
- "dev": true,
- "requires": {
- "@types/estree": "*",
- "@types/json-schema": "*"
- }
- },
- "@types/eslint-scope": {
- "version": "3.7.4",
- "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz",
- "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==",
- "dev": true,
- "requires": {
- "@types/eslint": "*",
- "@types/estree": "*"
- }
- },
"@types/estree": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
@@ -6707,9 +6666,9 @@
"dev": true
},
"enhanced-resolve": {
- "version": "5.17.0",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz",
- "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==",
+ "version": "5.17.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz",
+ "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==",
"dev": true,
"requires": {
"graceful-fs": "^4.2.4",
@@ -8529,12 +8488,11 @@
}
},
"webpack": {
- "version": "5.92.1",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.92.1.tgz",
- "integrity": "sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==",
+ "version": "5.94.0",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz",
+ "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==",
"dev": true,
"requires": {
- "@types/eslint-scope": "^3.7.3",
"@types/estree": "^1.0.5",
"@webassemblyjs/ast": "^1.12.1",
"@webassemblyjs/wasm-edit": "^1.12.1",
@@ -8543,7 +8501,7 @@
"acorn-import-attributes": "^1.9.5",
"browserslist": "^4.21.10",
"chrome-trace-event": "^1.0.2",
- "enhanced-resolve": "^5.17.0",
+ "enhanced-resolve": "^5.17.1",
"es-module-lexer": "^1.2.1",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
diff --git a/services/drupal/web/modules/custom/epa_wysiwyg/package.json b/services/drupal/web/modules/custom/epa_wysiwyg/package.json
index 7debdab7ef..4f612210fe 100644
--- a/services/drupal/web/modules/custom/epa_wysiwyg/package.json
+++ b/services/drupal/web/modules/custom/epa_wysiwyg/package.json
@@ -15,7 +15,7 @@
"raw-loader": "^4.0.2",
"style-loader": "^3.3.2",
"terser-webpack-plugin": "^5.2.0",
- "webpack": "^5.76.0",
+ "webpack": "^5.94.0",
"webpack-cli": "^4.4.0"
},
"dependencies": {
diff --git a/services/drupal/web/modules/custom/f1_sso/src/Controller/SSOController.php b/services/drupal/web/modules/custom/f1_sso/src/Controller/SSOController.php
index 6aab834488..205e8741b9 100644
--- a/services/drupal/web/modules/custom/f1_sso/src/Controller/SSOController.php
+++ b/services/drupal/web/modules/custom/f1_sso/src/Controller/SSOController.php
@@ -54,7 +54,7 @@ public function userLogin() {
'destination' => $destination_url,
]);
- return RedirectResponse::create($destination->toString());
+ return new RedirectResponse($destination->toString());
}
}
diff --git a/services/drupal/web/themes/epa_theme/.stylelintrc.yml b/services/drupal/web/themes/epa_theme/.stylelintrc.yml
index 648943e057..43d4597de0 100644
--- a/services/drupal/web/themes/epa_theme/.stylelintrc.yml
+++ b/services/drupal/web/themes/epa_theme/.stylelintrc.yml
@@ -2,6 +2,7 @@ extends:
- stylelint-config-sass-guidelines
plugins:
+ - stylelint-order
- stylelint-prettier
- stylelint-selector-pseudo-class-lvhfa
- stylelint-order
diff --git a/services/drupal/web/themes/epa_theme/epa_theme.libraries.yml b/services/drupal/web/themes/epa_theme/epa_theme.libraries.yml
index 68152c08ef..857ee02039 100644
--- a/services/drupal/web/themes/epa_theme/epa_theme.libraries.yml
+++ b/services/drupal/web/themes/epa_theme/epa_theme.libraries.yml
@@ -1,9 +1,9 @@
common:
- version: 20240812
+ version: 20240913
js:
js/dist/common.min.js: { minified: true }
global:
- version: 20240812
+ version: 20240913
css:
theme:
css/styles.css: {}
@@ -32,7 +32,7 @@ global:
- epa_theme/font_simplified_chinese
- epa_theme/font_traditional_chinese
before_after_swipe:
- version: 20240812
+ version: 20240913
js:
js/dist/before-after-swipe.min.js: { minified: true }
dependencies:
@@ -40,7 +40,7 @@ before_after_swipe:
- core/once
- epa_theme/common
details:
- version: 20240812
+ version: 20240913
js:
js/libraries/details-element-polyfill.js: {}
font_arabic:
@@ -68,7 +68,7 @@ font_traditional_chinese:
theme:
fonts/noto-sans-tc.css: {}
image_gallery:
- version: 20240812
+ version: 20240913
js:
js/dist/image-gallery.min.js: { minified: true }
dependencies:
@@ -76,7 +76,7 @@ image_gallery:
- core/once
- epa_theme/common
hero_slideshow:
- version: 20240812
+ version: 20240913
js:
js/dist/hero-slideshow.min.js: { minified: true }
dependencies:
@@ -84,19 +84,27 @@ hero_slideshow:
- core/once
- epa_theme/common
media_link:
- version: 20240812
+ version: 20240913
js:
js/dist/media-link.min.js: { minified: true }
dependencies:
- core/drupal
- core/once
- epa_theme/common
+sidenav_menu:
+ version: 20240913
+ js:
+ js/dist/sidenav-menu.min.js: { minified: true }
+ dependencies:
+ - core/drupal
+ - core/once
+ - epa_theme/common
svgxuse:
version: 1.2.6
js:
js/libraries/svgxuse.min.js: { minified: true }
toggle_admin:
- version: 20240812
+ version: 20240913
js:
js/dist/toggle-admin.min.js: { minified: true }
dependencies:
diff --git a/services/drupal/web/themes/epa_theme/images/drupal-sprite.artifact.svg b/services/drupal/web/themes/epa_theme/images/drupal-sprite.artifact.svg
new file mode 100644
index 0000000000..dcbd676da1
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/images/drupal-sprite.artifact.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/services/drupal/web/themes/epa_theme/includes/block.inc b/services/drupal/web/themes/epa_theme/includes/block.inc
index 4fa36a48ce..0cb714ca90 100644
--- a/services/drupal/web/themes/epa_theme/includes/block.inc
+++ b/services/drupal/web/themes/epa_theme/includes/block.inc
@@ -6,6 +6,7 @@
*/
use Drupal\block_content\BlockContentInterface;
+use Drupal\Core\Link;
/**
* Implements hook_theme_suggestions_HOOK_alter().
@@ -35,3 +36,46 @@ function epa_theme_theme_suggestions_block_alter(array &$suggestions, array $var
}
}
}
+
+/**
+ * Implements hook_preprocess_HOOK().
+ *
+ * Load up the group short name and use it as the label for the menu block. Also
+ * set the block title to be a link to the web area's homepage node.
+ */
+function epa_theme_preprocess_block__webareamenu(&$variables) {
+ // Ensure we have a group ID and items in the menu before proceeding.
+ if (
+ !empty($variables['elements']['#contextual_links']['group_menu']['route_parameters']['group']) &&
+ !empty($variables['content']['#items'])
+ ) {
+ $group_id = $variables['elements']['#contextual_links']['group_menu']['route_parameters']['group'];
+ /** @var \Drupal\group\Entity\GroupInterface $group */
+ $group = \Drupal::entityTypeManager()
+ ->getStorage('group')
+ ->load($group_id);
+
+ // 'Title' property is labeled as 'short name'.
+ $short_name = $group->get('label')->value;
+
+ // Set the short name as the block's label.
+ $variables['label'] = $short_name;
+ $variables['label_display'] = 1;
+
+ // Now get the web area's set homepage node and get the url for that to
+ // use as link URL.
+ /** @var \Drupal\node\NodeInterface $homepage_node */
+ $homepage_node = $group->get('field_homepage')->entity;
+ if (!$homepage_node) {
+ return;
+ }
+
+ if ($homepage_node->isPublished()) {
+ $homepage_url = $homepage_node->toUrl();
+ $homepage_link = Link::fromTextAndUrl($short_name, $homepage_url);
+ $variables['label'] = $homepage_link->toRenderable();
+ }
+ // Ensure the block caching is based on the web area's homepage as well.
+ $variables['#cache']['tags'][] = 'node:' . $homepage_node->id();
+ }
+}
diff --git a/services/drupal/web/themes/epa_theme/includes/field.inc b/services/drupal/web/themes/epa_theme/includes/field.inc
index f5a1e98327..f2a9be1fa2 100644
--- a/services/drupal/web/themes/epa_theme/includes/field.inc
+++ b/services/drupal/web/themes/epa_theme/includes/field.inc
@@ -5,6 +5,9 @@
* Field template functions.
*/
+use Drupal\Core\Render\Element;
+use Drupal\node\NodeInterface;
+
/**
* Implements hook_theme_suggestions_field_alter().
*/
@@ -40,4 +43,70 @@ function epa_theme_preprocess_field(&$variables) {
}
}
}
+
+ if ($element['#field_name'] == 'field_subjects') {
+ _alter_field_subjects($variables);
+ }
+}
+
+/**
+ * Custom alteration logic for field_subjects to output additional text.
+ *
+ * @param $variables
+ * The $variables render array from epa_theme_preprocess_field.
+ *
+ * @return void
+ *
+ * Custom function to add some additional text to the field_subjects links.
+ * The items are themed as `hierarchical_term_facet_formatter` which is a custom
+ * formatter in the epa_core module. The link text is typically derived from the
+ * referenced Term's name. Here we alter the name to get the additional text we want
+ *
+ * @see \template_preprocess_hierarchical_term_facet_formatter()
+ * @link https://forumone.atlassian.net/browse/EPAD8-2406
+ */
+function _alter_field_subjects(&$variables) {
+ // Prevent moving on if not a node. This custom function only applies to
+ // nodes that have the field_subjects
+ if (!$variables['element']['#object'] instanceof NodeInterface) {
+ return;
+ }
+
+ /** @var \Drupal\node\Entity\Node $node */
+ $node = $variables['element']['#object'];
+
+ // If field subjects is empty exit out.
+ if ($node->get('field_subjects')->isEmpty()) {
+ return;
+ }
+
+ // We want to display the bundle label, however those are singular. There's
+ // currently no way in core to provide a "plural" label so we'll provide our own.
+ // @todo Review this later when https://www.drupal.org/node/2773615 lands.
+ $plural_bundles = [
+ 'perspective' => 'Perspectives',
+ 'news_release' => 'News Releases',
+ 'speeches' => 'Speeches & Remarks',
+ ];
+
+ // Loop over each subject in the field and alter the term name to be what we want.
+ foreach (Element::children($variables['items']) as $key) {
+ // See logic above in \epa_theme_preprocess_field.
+ // We do some alterations for this field already if it's a perspective node.
+ if (!isset($variables['items'][$key]['content']['#terms'])) {
+ continue;
+ }
+
+ /** @var \Drupal\taxonomy\Entity\Term[] $terms */
+ $terms = $variables['items'][$key]['content']['#terms'];
+
+ $term = reset($terms);
+ $translated = t("Read other EPA @bundle about @name", [
+ '@bundle' => $plural_bundles[$node->bundle()],
+ '@name' => $term->getName(),
+ ]);
+ $term->setName($translated);
+ $variables['items'][$key]['content']['#terms'][0] = $term;
+ }
+
}
diff --git a/services/drupal/web/themes/epa_theme/includes/navigation.inc b/services/drupal/web/themes/epa_theme/includes/navigation.inc
index 564e042a52..ad8db85f28 100644
--- a/services/drupal/web/themes/epa_theme/includes/navigation.inc
+++ b/services/drupal/web/themes/epa_theme/includes/navigation.inc
@@ -81,3 +81,31 @@ function epa_theme_preprocess_menu_local_tasks(&$variables) {
$variables[$type] = $tabs;
}
}
+
+/**
+ * Implements hook_preprocess_breadcrumb().
+ */
+function epa_theme_preprocess_breadcrumb(array &$variables) {
+ if ($variables['breadcrumb']) {
+ /** @var \Drupal\Core\Render\Renderer $renderer */
+ $renderer = \Drupal::service('renderer');
+ $variables['include_current_page']
+ = theme_get_setting('include_current_page_in_breadcrumb', 'epa_theme') ?? TRUE;
+ $themeConfig = \Drupal::config('epa_theme.settings');
+ $renderer->addCacheableDependency($variables, $themeConfig);
+
+ if ($variables['include_current_page']) {
+ $request = \Drupal::request();
+ $route_match = \Drupal::routeMatch();
+ $variables['#cache']['contexts'][] = 'route';
+ $page_title = \Drupal::service('title_resolver')->getTitle($request, $route_match->getRouteObject());
+
+ if (!empty($page_title)) {
+ $variables['page_title'] = $page_title;
+ $variables['breadcrumb'][] = [
+ 'text' => $page_title,
+ ];
+ }
+ }
+ }
+}
diff --git a/services/drupal/web/themes/epa_theme/includes/node.inc b/services/drupal/web/themes/epa_theme/includes/node.inc
index 4eceffcd9e..234fde7e6d 100644
--- a/services/drupal/web/themes/epa_theme/includes/node.inc
+++ b/services/drupal/web/themes/epa_theme/includes/node.inc
@@ -5,6 +5,7 @@
*/
use Drupal\Core\Link;
+use Drupal\group\Entity\GroupContent;
/**
* Implements hook_preprocess_node().
@@ -19,6 +20,21 @@ function epa_theme_preprocess_node(&$variables) {
// Array of regions to add to node template.
$allowed_regions = ['messages'];
_add_regions_to_node($allowed_regions, $variables);
+ $node = $variables['node'];
+ _add_webarea_contact_link($node, $variables);
+ }
+}
+
+/**
+ * Implements hook_preprocess_node__VIEW_MODE().
+ *
+ * Retrieves the node's Group's referenced webform and adds it as a variable.
+ */
+function epa_theme_preprocess_node__full(&$variables) {
+ /** @var \Drupal\node\Entity\Node $node */
+ $node = $variables['node'];
+ if (!isset($variables['webarea_contact_link'])) {
+ _add_webarea_contact_link($node, $variables);
}
}
@@ -28,6 +44,7 @@ function epa_theme_preprocess_node(&$variables) {
function epa_theme_preprocess_node__news_release__full(&$variables) {
/** @var \Drupal\node\NodeInterface $node */
$node = $variables['node'];
+ _add_webarea_contact_link($node, $variables);
$language = $node->get('field_language')->value;
@@ -149,6 +166,32 @@ function epa_theme_preprocess_node__news_release__full(&$variables) {
}
}
+/**
+ * Implements hook_preprocess_node__BUNDEL__VIEW_MODE().
+ */
+function epa_theme_preprocess_node__perspective__full(&$variables) {
+ /** @var \Drupal\node\Entity\Node $node */
+ $node = $variables['node'];
+ if (!isset($variables['webarea_contact_link'])) {
+ _add_webarea_contact_link($node, $variables);
+ }
+
+ // Because the perspectives uses layout builder we need to build the subjects field separately.
+ $variables['subjects'] = $node->get('field_subjects')->view(
+ [
+ 'label' => 'hidden',
+ 'type' => 'epa_core_hierarchical_term_facet_formatter',
+ 'settings' => [
+ 'display' => 'all',
+ 'link' => TRUE,
+ 'wrap' => 'none',
+ 'separator' => ' | ',
+ 'reverse' => FALSE,
+ 'facet_source' => 'perspectives_subjects'
+ ]
+ ]);
+}
+
/**
* Custom function to add page regions to node templates.
*/
@@ -180,3 +223,30 @@ function _add_regions_to_node($allowed_regions, &$variables) {
$variables['region_' . $region] = $build;
}
}
+
+/**
+ * Custom function to add Web Area contact link to node templates.
+ *
+ * @param $entity
+ * The node to get the Group contact link for.
+ * @param $variables
+ * The node render array variables.
+ *
+ * @return void
+ * @throws \Drupal\Core\Entity\EntityMalformedException
+ */
+function _add_webarea_contact_link($entity, &$variables) {
+ $group_contents = GroupContent::loadByEntity($entity);
+ if (!empty($group_contents)) {
+ /** @var \Drupal\group\Entity\GroupContent $group_content */
+ $group_content = reset($group_contents);
+ $group = $group_content->getGroup();
+ /** @var \Drupal\node\Entity\Node[] $webform */
+ $webform = $group->get('field_contact_us_form')->referencedEntities();
+ $webform = reset($webform);
+ // Only apply the variable if the link isn't to itself.
+ if ($webform && ($entity->id() !== $webform->id())) {
+ $variables['webarea_contact_link'] = $webform->toLink()->toRenderable();
+ }
+ }
+}
diff --git a/services/drupal/web/themes/epa_theme/js/src/modules/navigation.js b/services/drupal/web/themes/epa_theme/js/src/modules/navigation.js
index d7ef56cbaf..ca0a228a55 100644
--- a/services/drupal/web/themes/epa_theme/js/src/modules/navigation.js
+++ b/services/drupal/web/themes/epa_theme/js/src/modules/navigation.js
@@ -1,5 +1,5 @@
export default function () {
- const subnav = once('navigation', '.menu--main .menu__subnav');
+ const subnav = once('navigation', '.menu--accordion .menu__subnav');
subnav.forEach((menu, index) => {
menu.setAttribute('hidden', true);
const button = menu.previousElementSibling;
@@ -9,4 +9,62 @@ export default function () {
button.setAttribute('aria-controls', id);
}
});
+
+ const mobileMQ = window.matchMedia('(max-width: 54.99em)');
+
+ if (mobileMQ.matches) {
+ const mobileMenuButton = document.querySelector('.l-header__menu-button');
+ const mobileMenuNav = document.querySelector('.usa-nav--epa');
+ let focusableMM;
+ let numberFocusElementsMM;
+ let firstFocusableElementMM;
+ let lastFocusableElementMM;
+ let priorLastElementMM;
+
+ mobileMenuButton.addEventListener('click', function () {
+ if (!focusableMM) {
+ focusableMM = Array.from(
+ mobileMenuNav.querySelectorAll(
+ 'button, [href], input, select, textarea'
+ )
+ ).filter(item => item.tabIndex !== -1 && item.hidden !== true);
+ numberFocusElementsMM = focusableMM.length;
+ firstFocusableElementMM = focusableMM[0];
+ lastFocusableElementMM = focusableMM[numberFocusElementsMM - 1];
+
+ const lastFocusParentMM = lastFocusableElementMM.closest('ul');
+
+ if (getComputedStyle(lastFocusParentMM).display === 'none') {
+ priorLastElementMM = lastFocusableElementMM;
+ lastFocusableElementMM = lastFocusParentMM.previousElementSibling;
+ }
+ }
+
+ if (lastFocusableElementMM) {
+ lastFocusableElementMM.addEventListener('click', function () {
+ const swapMM = lastFocusableElementMM;
+ lastFocusableElementMM = priorLastElementMM;
+ priorLastElementMM = swapMM;
+ });
+ }
+ });
+
+ mobileMenuNav.addEventListener('keydown', event => {
+ if (event.key === 'Tab') {
+ if (
+ event.shiftKey &&
+ document.activeElement === firstFocusableElementMM
+ ) {
+ event.preventDefault();
+ lastFocusableElementMM.focus();
+ } else if (
+ document.activeElement === lastFocusableElementMM &&
+ !event.shiftKey
+ ) {
+ event.preventDefault();
+ firstFocusableElementMM.focus();
+ }
+ }
+ });
+ }
}
diff --git a/services/drupal/web/themes/epa_theme/js/src/sidenav-menu.es6.js b/services/drupal/web/themes/epa_theme/js/src/sidenav-menu.es6.js
new file mode 100644
index 0000000000..2bdf221cca
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/js/src/sidenav-menu.es6.js
@@ -0,0 +1,99 @@
+// Sidenav menu script
+import Drupal from 'drupal';
+
+(function (Drupal) {
+ Drupal.behaviors.sidenavMenu = {
+ attach(context) {
+ once('sidenav-menu', 'html').forEach(() => {
+ const pageBody = document.body;
+ const sideNavMenu = context.querySelector('.menu--sidenav-nav');
+ const sideNavTrigger = context.querySelector('.web-area-menu__button');
+ const sideNavOverlay = context.querySelector('.menu-sidenav__overlay');
+ const blockWebArea = context.getElementById('block-webareamenu');
+ const sideNavContact = context.getElementById('menu-sidenav__contact');
+ let focusable;
+ let numberFocusElements;
+ let firstFocusableElement;
+ let lastFocusableElement;
+ let priorLastElement;
+
+ const sideNavContactClone = sideNavContact.cloneNode(true);
+
+ if (sideNavContactClone !== null) {
+ sideNavContactClone.classList.add('-mobile');
+ sideNavContactClone.id = 'menu-sidenav__contact-mobile';
+ sideNavMenu.append(sideNavContactClone);
+ }
+
+ function toggleVisiblity() {
+ pageBody.classList.toggle('menu-sidenav--active');
+ sideNavMenu.classList.toggle('is-visible');
+ sideNavTrigger.classList.toggle('is-open');
+ sideNavOverlay.classList.toggle('is-visible');
+
+ if (!focusable) {
+ focusable = Array.from(
+ blockWebArea.querySelectorAll(
+ 'button, [href], input, select, textarea'
+ )
+ ).filter(item => item.tabIndex !== -1 && item.hidden !== true);
+ numberFocusElements = focusable.length;
+ firstFocusableElement = focusable[0];
+ lastFocusableElement = focusable[numberFocusElements - 1];
+
+ const lastFocusParent = lastFocusableElement.closest('ul');
+
+ if (getComputedStyle(lastFocusParent).display === 'none') {
+ priorLastElement = lastFocusableElement;
+ lastFocusableElement = lastFocusParent.previousElementSibling;
+ }
+ }
+
+ if (lastFocusableElement) {
+ lastFocusableElement.addEventListener('click', function () {
+ const swap = lastFocusableElement;
+ lastFocusableElement = priorLastElement;
+ priorLastElement = swap;
+ });
+ }
+ }
+
+ [sideNavOverlay, sideNavTrigger].forEach(elem => {
+ elem.addEventListener('click', toggleVisiblity);
+ });
+
+ const subNavMenus = context.querySelectorAll(
+ '.menu--sidenav .menu__subnav'
+ );
+
+ subNavMenus.forEach((subNav, index) => {
+ const subId = `sub-menu-${index}`;
+ const subBtnSib = subNav.previousElementSibling;
+ subNav.setAttribute('id', subId);
+ subBtnSib.setAttribute('aria-controls', subId);
+ });
+
+ blockWebArea.addEventListener('keydown', event => {
+ if (
+ event.key === 'Tab' &&
+ sideNavMenu.classList.contains('is-visible')
+ ) {
+ if (
+ event.shiftKey &&
+ document.activeElement === firstFocusableElement
+ ) {
+ event.preventDefault();
+ lastFocusableElement.focus();
+ } else if (
+ document.activeElement === lastFocusableElement &&
+ !event.shiftKey
+ ) {
+ event.preventDefault();
+ firstFocusableElement.focus();
+ }
+ }
+ });
+ });
+ },
+ };
+})(Drupal);
diff --git a/services/drupal/web/themes/epa_theme/package-lock.json b/services/drupal/web/themes/epa_theme/package-lock.json
index 3431f4cd70..55d60472dc 100644
--- a/services/drupal/web/themes/epa_theme/package-lock.json
+++ b/services/drupal/web/themes/epa_theme/package-lock.json
@@ -56,7 +56,7 @@
"stylelint-selector-pseudo-class-lvhfa": "^3.1.1",
"terser-webpack-plugin": "^5.3.10",
"unset-value": "^2.0.1",
- "webpack": "^5.90.0",
+ "webpack": "^5.94.0",
"yaml": "^1.10.2"
},
"engines": {
@@ -3868,16 +3868,6 @@
"@types/json-schema": "*"
}
},
- "node_modules/@types/eslint-scope": {
- "version": "3.7.7",
- "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz",
- "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==",
- "dev": true,
- "dependencies": {
- "@types/eslint": "*",
- "@types/estree": "*"
- }
- },
"node_modules/@types/estree": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
@@ -6655,9 +6645,9 @@
}
},
"node_modules/enhanced-resolve": {
- "version": "5.17.0",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz",
- "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==",
+ "version": "5.17.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz",
+ "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.4",
@@ -15996,12 +15986,11 @@
"dev": true
},
"node_modules/webpack": {
- "version": "5.92.1",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.92.1.tgz",
- "integrity": "sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==",
+ "version": "5.94.0",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz",
+ "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==",
"dev": true,
"dependencies": {
- "@types/eslint-scope": "^3.7.3",
"@types/estree": "^1.0.5",
"@webassemblyjs/ast": "^1.12.1",
"@webassemblyjs/wasm-edit": "^1.12.1",
@@ -16010,7 +15999,7 @@
"acorn-import-attributes": "^1.9.5",
"browserslist": "^4.21.10",
"chrome-trace-event": "^1.0.2",
- "enhanced-resolve": "^5.17.0",
+ "enhanced-resolve": "^5.17.1",
"es-module-lexer": "^1.2.1",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
@@ -19129,16 +19118,6 @@
"@types/json-schema": "*"
}
},
- "@types/eslint-scope": {
- "version": "3.7.7",
- "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz",
- "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==",
- "dev": true,
- "requires": {
- "@types/eslint": "*",
- "@types/estree": "*"
- }
- },
"@types/estree": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
@@ -21328,9 +21307,9 @@
}
},
"enhanced-resolve": {
- "version": "5.17.0",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz",
- "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==",
+ "version": "5.17.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz",
+ "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==",
"dev": true,
"requires": {
"graceful-fs": "^4.2.4",
@@ -28470,12 +28449,11 @@
"dev": true
},
"webpack": {
- "version": "5.92.1",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.92.1.tgz",
- "integrity": "sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==",
+ "version": "5.94.0",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz",
+ "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==",
"dev": true,
"requires": {
- "@types/eslint-scope": "^3.7.3",
"@types/estree": "^1.0.5",
"@webassemblyjs/ast": "^1.12.1",
"@webassemblyjs/wasm-edit": "^1.12.1",
@@ -28484,7 +28462,7 @@
"acorn-import-attributes": "^1.9.5",
"browserslist": "^4.21.10",
"chrome-trace-event": "^1.0.2",
- "enhanced-resolve": "^5.17.0",
+ "enhanced-resolve": "^5.17.1",
"es-module-lexer": "^1.2.1",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
diff --git a/services/drupal/web/themes/epa_theme/package.json b/services/drupal/web/themes/epa_theme/package.json
index 6d721d4e4e..011b22d7bf 100644
--- a/services/drupal/web/themes/epa_theme/package.json
+++ b/services/drupal/web/themes/epa_theme/package.json
@@ -60,7 +60,7 @@
"stylelint-selector-pseudo-class-lvhfa": "^3.1.1",
"terser-webpack-plugin": "^5.3.10",
"unset-value": "^2.0.1",
- "webpack": "^5.90.0",
+ "webpack": "^5.94.0",
"yaml": "^1.10.2"
},
"scripts": {
diff --git a/services/drupal/web/themes/epa_theme/source/_data/data.yml b/services/drupal/web/themes/epa_theme/source/_data/data.yml
index 9f4f8ae536..f0b78a139a 100644
--- a/services/drupal/web/themes/epa_theme/source/_data/data.yml
+++ b/services/drupal/web/themes/epa_theme/source/_data/data.yml
@@ -320,7 +320,7 @@ summary: 'This is the summary, which can contain Contact Us to ask a question, provide feedback, or report a problem.'
+footer: ''
title: 'Title'
url: '#'
reset_url: '#'
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/00-config/config.design-tokens.yml b/services/drupal/web/themes/epa_theme/source/_patterns/00-config/config.design-tokens.yml
index 594142ed0b..6d4bee04d5 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/00-config/config.design-tokens.yml
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/00-config/config.design-tokens.yml
@@ -78,12 +78,12 @@ uswds:
link-hover-color: 'primary-dark'
link-active-color: 'primary-darker'
# https://github.com/uswds/uswds/blob/develop/packages/uswds-core/src/styles/settings/_settings-components.scss
- banner-max-width: 'desktop'
- header-max-width: 'desktop'
+ banner-max-width: 'widescreen'
+ header-max-width: 'widescreen'
header-min-width: 'tablet-lg'
# https://github.com/uswds/uswds/blob/develop/packages/uswds-core/src/styles/settings/_settings-spacing.scss
column-gap-desktop: 5
- grid-container-max-width: 'desktop'
+ grid-container-max-width: 'widescreen'
site-margins-width: 4
site-margins-mobile-width: 3
# https://github.com/uswds/uswds/blob/develop/packages/uswds-core/src/styles/settings/_settings-utilities.scss
@@ -350,9 +350,9 @@ gesso:
sass: 'shadow(5)'
fallback: '0 16px 32px 0 rgba(0, 0, 0, 0.1)'
constrains:
- sm: 880px
+ sm: 1024px
md: !uswds uswds.grid-container-max-width
- lg: 1200px
+ lg: 1400px
breakpoints:
mobile: !sass
sass: 'units(mobile)'
@@ -396,6 +396,11 @@ gesso:
fallback: '#54278f'
background:
site: grayscale.white
+ breadcrumb:
+ background: grayscale.white
+ divider: grayscale.gray-3
+ link: grayscale.black
+ text: uswds.primary.base
button:
primary:
background: uswds.primary.base
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/03-uswds/accordion/accordion--multiselectable/accordion--multiselectable.twig b/services/drupal/web/themes/epa_theme/source/_patterns/03-uswds/accordion/accordion--multiselectable/accordion--multiselectable.twig
index b958e7e106..4f7dd42c8d 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/03-uswds/accordion/accordion--multiselectable/accordion--multiselectable.twig
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/03-uswds/accordion/accordion--multiselectable/accordion--multiselectable.twig
@@ -1,3 +1,8 @@
+{% set classes = [
+ 'usa-accordion--multiselectable',
+ modifier_classes ? modifier_classes,
+]|join(' ')|trim %}
+
{% include '@uswds/accordion/accordion.twig' with {
'modifier_classes': modifier_classes,
'is_multi_selectable': is_multi_selectable,
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/_index.scss b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/_index.scss
index 420e820fb8..2761df9c54 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/_index.scss
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/_index.scss
@@ -1,3 +1,4 @@
@forward 'constrain';
@forward 'constrain--large/constrain--large';
@forward 'constrain--no-padding/constrain--no-padding';
+@forward 'constrain--small/constrain--small';
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/_constrain--small.scss b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/_constrain--small.scss
new file mode 100644
index 0000000000..a3befd4cb8
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/_constrain--small.scss
@@ -0,0 +1,8 @@
+// @file
+// Styles for a Small Constrain layout.
+
+@use '../../../00-config' as *;
+
+.l-constrain--small {
+ max-width: rem(gesso-constrain(sm));
+}
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/constrain--small.md b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/constrain--small.md
new file mode 100644
index 0000000000..cfb3ff605f
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/constrain--small.md
@@ -0,0 +1,11 @@
+---
+el: .l-constrain--small
+title: Small Constrain Layout
+state: complete
+---
+
+__Variables:__
+* modifier_classes: [string] Classes to modify the default component styling.
+
+__Blocks:__
+* content: Twig block for content.
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/constrain--small.twig b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/constrain--small.twig
new file mode 100644
index 0000000000..af48628dbe
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/constrain--small.twig
@@ -0,0 +1,8 @@
+{% set classes = [
+ 'l-constrain--small',
+ modifier_classes ? modifier_classes,
+]|join(' ')|trim %}
+
+{% include '@layouts/constrain/constrain.twig' with {
+ 'modifier_classes': classes,
+} %}
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/constrain--small.yml b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/constrain--small.yml
new file mode 100644
index 0000000000..ed97d539c0
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/constrain/constrain--small/constrain--small.yml
@@ -0,0 +1 @@
+---
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/_page.scss b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/_page.scss
index 65baba1b4a..bcd763d3df 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/_page.scss
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/_page.scss
@@ -53,6 +53,49 @@
justify-content: space-between;
width: 100%;
}
+
+ .l-constrain {
+ flex-wrap: wrap;
+ }
+ }
+
+ .page-has-sidebar &,
+ .page-no-sidebar & {
+ background-color: gesso-grayscale(white);
+ margin-top: 0;
+ padding-bottom: rem(gesso-spacing(6));
+
+ .l-constrain,
+ .block {
+ flex-wrap: wrap;
+ }
+ }
+
+ .page-no-sidebar & {
+ .l-constrain {
+ display: flex;
+ padding-top: rem(gesso-spacing(3));
+ position: relative;
+
+ &::before {
+ background-color: gesso-grayscale(gray-3);
+ content: '';
+ height: 1px;
+ position: absolute;
+ top: 0;
+ width: measure(5);
+ }
+ }
+ }
+}
+
+.l-page__footer-contact {
+ .page-has-sidebar & {
+ display: none;
+ }
+
+ .page-no-sidebar & {
+ width: 100%;
}
}
@@ -60,10 +103,31 @@
font-size: font-size(body, 3xs);
line-height: gesso-line-height(2);
margin-top: 1rem;
- text-transform: uppercase;
@include at-media($theme-site-margins-breakpoint) {
margin-left: 1rem;
margin-top: 0;
}
+
+ .page-has-sidebar & {
+ @include breakpoint(gesso-breakpoint(sidebar)) {
+ margin-left: calc(25% + 2.5rem);
+ }
+ }
+
+ .page-no-sidebar & {
+ margin-left: 0;
+ margin-top: rem(gesso-spacing(1));
+ width: 100%;
+ }
+}
+
+.l-page__footer-contact-last {
+ font-size: font-size(body, 3xs);
+ line-height: gesso-line-height(2);
+
+ @include at-media($theme-site-margins-breakpoint) {
+ text-align: right;
+ width: 100%;
+ }
}
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/page.md b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/page.md
index 58375bd506..df0996f253 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/page.md
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/page.md
@@ -10,7 +10,7 @@ __Variables:__
* has_footer: [boolean] Whether the page has footer content.
__Blocks:__
-* info: Twig block for web area or hublinks.
+* info: Twig block for web area.
* contact: Twig block for contact info.
* content: Twig block for content.
* footer: Twig block for footer content.
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/page.twig b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/page.twig
index 7cbdf5c3d4..e7f1f615b3 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/page.twig
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/page/page.twig
@@ -4,8 +4,14 @@
has_footer ? 'has-footer',
]|join(' ')|trim %}
+
+{% set constrain_classes = [
+ 'l-constrain',
+ is_narrow ? 'l-constrain--small'
+]|join(' ')|trim %}
+
-
+
{% if has_header %}
-
{% endif %}
@@ -35,7 +34,7 @@
{% if has_footer %}
Administrator Michael Regan
September 24th, 2022 Warren, North Carolina
@@ -47,12 +34,25 @@ because it’s mostly Black. Nobody thought people like us would make a fuss.”
{% endset %}
+{% set sidenav %}
+ {% include '@components/box/box--related-links/box--related-links.twig' with {
+ 'modifier_classes': 'margin-y-4',
+ 'content': related_info,
+ 'title': {
+ 'tag': 'h2',
+ 'text': 'Related Links'|t,
+ },
+ } only %}
+{% endset %}
+
{% set page_content %}
- {% include '@templates/detail-pages/page.twig' with {
+ {% include '@templates/detail-pages/page-with-sidenav.twig' with {
'title': page_title,
'admin_info': page_admin_info,
'intro': intro,
'body': content,
+ 'sidenav': sidenav,
+ 'has_sidenav': has_sidenav,
} %}
{% endset %}
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/speech-remark.yml b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/speech-remark.yml
index f31c96e2bf..8b19d583ab 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/speech-remark.yml
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/speech-remark.yml
@@ -4,3 +4,12 @@ intro: ''
links:
- url: '#'
text: 'Speeches'
+has_sidenav: true
+related_info: |-
+
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/webform-with-sidenav.twig b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/webform-with-sidenav.twig
index e4f4e65db0..d76414df0a 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/webform-with-sidenav.twig
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/webform-with-sidenav.twig
@@ -1,9 +1,3 @@
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'Enforcement',
- } %}
-{% endset %}
-
{% set contact_link %}
{% include '@components/header-link/header-link.twig' with {
'url': '#',
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/webform.twig b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/webform.twig
index 49b9809223..e67e171345 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/webform.twig
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/detail-pages/webform.twig
@@ -1,9 +1,3 @@
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'EPA in New York',
- } %}
-{% endset %}
-
{% set contact_link %}
{% include '@components/header-link/header-link.twig' with {
'url': '#',
@@ -76,6 +70,7 @@
'intro': intro,
'body': content,
'sidebar': sidebar,
+ 'is_narrow': true,
} %}
{% endset %}
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/frequent-questions.twig b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/frequent-questions.twig
index c42025a45d..9244082d03 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/frequent-questions.twig
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/frequent-questions.twig
@@ -1,9 +1,3 @@
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'Frequent Questions',
- } %}
-{% endset %}
-
{% set contact_link %}
{% include '@components/header-link/header-link.twig' with {
'url': '#',
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/news-releases.twig b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/news-releases.twig
index 285d7b14b9..f00514a94d 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/news-releases.twig
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/news-releases.twig
@@ -1,9 +1,3 @@
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'News Releases',
- } %}
-{% endset %}
-
{% set contact_link %}
{% include '@components/header-link/header-link.twig' with {
'url': '#',
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/perspectives.twig b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/perspectives.twig
index f8d6c22635..e3d64d7af4 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/perspectives.twig
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/perspectives.twig
@@ -1,9 +1,3 @@
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'Perspectives',
- } %}
-{% endset %}
-
{% set contact_link %}
{% include '@components/header-link/header-link.twig' with {
'url': '#',
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/public-notices.twig b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/public-notices.twig
index 3080583a8b..24c96e70cd 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/public-notices.twig
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/public-notices.twig
@@ -1,9 +1,3 @@
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'Public Notices',
- } %}
-{% endset %}
-
{% set contact_link %}
{% include '@components/header-link/header-link.twig' with {
'url': '#',
diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/speeches-remarks.twig b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/speeches-remarks.twig
index d3260f414a..79e3f8d55b 100644
--- a/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/speeches-remarks.twig
+++ b/services/drupal/web/themes/epa_theme/source/_patterns/07-pages/listing-pages/speeches-remarks.twig
@@ -1,9 +1,3 @@
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'Speeches and Remarks',
- } %}
-{% endset %}
-
{% set contact_link %}
{% include '@components/header-link/header-link.twig' with {
'url': '#',
diff --git a/services/drupal/web/themes/epa_theme/templates/block/block--fixed--perspectives-editors-note.html.twig b/services/drupal/web/themes/epa_theme/templates/block/block--fixed--perspectives-editors-note.html.twig
index a7379c4bc7..5b1c9aac14 100644
--- a/services/drupal/web/themes/epa_theme/templates/block/block--fixed--perspectives-editors-note.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/block/block--fixed--perspectives-editors-note.html.twig
@@ -6,6 +6,6 @@
#}
{% include '@components/box/box--special/box--special.twig' with {
- 'modifier_classes': 'margin-y-4 font-sans-3xs',
+ 'modifier_classes': 'margin-y-4 font-sans-3xs box--editors-note',
'content': content,
} only %}
diff --git a/services/drupal/web/themes/epa_theme/templates/block/block--webareamenu.html.twig b/services/drupal/web/themes/epa_theme/templates/block/block--webareamenu.html.twig
index 9c4510571c..df8f840ec9 100644
--- a/services/drupal/web/themes/epa_theme/templates/block/block--webareamenu.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/block/block--webareamenu.html.twig
@@ -4,4 +4,33 @@
* Theme override for the group menus block.
*/
#}
-{% extends "block--admin.html.twig" %}
+{{ attach_library('epa_theme/sidenav_menu') }}
+
+{% set classes = [
+ 'block--web-area-menu',
+] %}
+
+{% set attributes = attributes.addClass(classes) %}
+
+{% set block_content %}
+ {% block block_content %}
+ {{ content }}
+ {% endblock %}
+{% endset %}
+
+
+
+{% embed '@components/block/block.twig' with {
+ 'hide_wrapper': false,
+ 'has_constrain': false,
+ 'title_prefix': title_prefix,
+ 'label': (label_display == '1') ? label : '',
+ 'title_suffix': title_suffix,
+ 'hide_content_wrapper': false,
+} %}
+
+ {% block content %}
+ {{ block_content }}
+ {% endblock %}
+
+{% endembed %}
diff --git a/services/drupal/web/themes/epa_theme/templates/content/node--event--full.html.twig b/services/drupal/web/themes/epa_theme/templates/content/node--event--full.html.twig
index 7cf937a1e7..b951b51f64 100644
--- a/services/drupal/web/themes/epa_theme/templates/content/node--event--full.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/content/node--event--full.html.twig
@@ -20,15 +20,13 @@
{% endif %}
{% set header_info %}
- {% if nav_style == 'sidebar_navigation' %}
- {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: false,shortname: true}}) }}
- {% else %}
- {{ node.field_hublinks|view({type: 'web_areas_homepage_link_formatter', settings: {}}) }}
- {% endif %}
+ {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: false,shortname: true}}) }}
+ {{ drupal_entity('block', 'epa_breadcrumbs', check_access=false) }}
{% endset %}
{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
+{# {{ drupal_entity('block', 'webareaheader', check_access=false) }}#}
+ {{ webarea_contact_link }}
{% endset %}
{% set admin_info %}
@@ -107,5 +105,6 @@
'show_admin_info': show_admin_info,
'body': body,
'footer': footer,
+ 'is_narrow': true,
} %}
{% endif %}
diff --git a/services/drupal/web/themes/epa_theme/templates/content/node--faq--full.html.twig b/services/drupal/web/themes/epa_theme/templates/content/node--faq--full.html.twig
index 99faf6fe65..2a838c9a68 100644
--- a/services/drupal/web/themes/epa_theme/templates/content/node--faq--full.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/content/node--faq--full.html.twig
@@ -20,20 +20,19 @@
{% endif %}
{% set header_info %}
- {% if nav_style == 'sidebar_navigation' %}
- {% if node.field_wide_template.value %}
- {% set display_sidenav = false %}
- {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: true,shortname: true}}) }}
- {% else %}
- {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: false,shortname: true}}) }}
- {% endif %}
+ {% if node.field_wide_template.value %}
+ {% set display_sidenav = false %}
+ {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: true,shortname: true}}) }}
+ {{ drupal_entity('block', 'epa_breadcrumbs', check_access=false) }}
{% else %}
- {{ node.field_hublinks|view({type: 'web_areas_homepage_link_formatter', settings: {}}) }}
+ {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: false,shortname: true}}) }}
+ {{ drupal_entity('block', 'epa_breadcrumbs', check_access=false) }}
{% endif %}
{% endset %}
{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
+{# {{ drupal_entity('block', 'webareaheader', check_access=false) }}#}
+ {{ webarea_contact_link }}
{% endset %}
{% set admin_info %}
@@ -92,5 +91,6 @@
'show_admin_info': show_admin_info,
'body': content|without('epa_content_moderation_info_box', 'field_question'),
'footer': footer,
+ 'is_narrow': true,
} %}
{% endif %}
diff --git a/services/drupal/web/themes/epa_theme/templates/content/node--full.html.twig b/services/drupal/web/themes/epa_theme/templates/content/node--full.html.twig
index 7786192d11..3d21e469e1 100644
--- a/services/drupal/web/themes/epa_theme/templates/content/node--full.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/content/node--full.html.twig
@@ -20,20 +20,18 @@
{% endif %}
{% set header_info %}
- {% if nav_style == 'sidebar_navigation' %}
- {% if node.field_wide_template.value %}
- {% set display_sidenav = false %}
- {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: true,shortname: true}}) }}
- {% else %}
- {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: false,shortname: true}}) }}
- {% endif %}
+ {% if node.field_wide_template.value %}
+ {% set display_sidenav = false %}
+ {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: true,shortname: true}}) }}
+ {{ drupal_entity('block', 'epa_breadcrumbs', check_access=false) }}
{% else %}
- {{ node.field_hublinks|view({type: 'web_areas_homepage_link_formatter', settings: {}}) }}
+ {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: false,shortname: true}}) }}
+ {{ drupal_entity('block', 'epa_breadcrumbs', check_access=false) }}
{% endif %}
{% endset %}
{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
+ {{ webarea_contact_link }}
{% endset %}
{% set admin_info %}
diff --git a/services/drupal/web/themes/epa_theme/templates/content/node--news-release--full.html.twig b/services/drupal/web/themes/epa_theme/templates/content/node--news-release--full.html.twig
index f4006f39cb..cf8ef1145f 100644
--- a/services/drupal/web/themes/epa_theme/templates/content/node--news-release--full.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/content/node--news-release--full.html.twig
@@ -11,6 +11,10 @@
not node.isPublished() ? 'is-unpublished',
] %}
+{% set header_info %}
+ {{ drupal_entity('block', 'epa_breadcrumbs', check_access=false) }}
+{% endset %}
+
{% set sidenav = drupal_region('sidebar') %}
{% set press_offices = [] %}
@@ -18,20 +22,35 @@
{% set press_offices = press_offices|merge([item|render]) %}
{% endfor %}
-{% set header_info %}
- {% include '@components/hublinks/hublinks.twig' with {
- 'title': 'News Releases'|t,
- 'links': press_offices,
- } %}
+{% if content.field_press_office|field_value is not empty or content.field_subjects|field_value is not empty or more_link %}
+ {% set related_info %}
+
+ {% endset %}
+{% endif %}
- {% include '@components/hublinks/hublinks.twig' with {
- 'title': '',
- 'links': [more_link],
- } %}
+{% set sidenav %}
+ {% include '@components/box/box--related-links/box--related-links.twig' with {
+ 'modifier_classes': 'margin-y-4',
+ 'content': related_info,
+ 'title': {
+ 'tag': 'h2',
+ 'text': 'Related Links'|t,
+ },
+ } only %}
{% endset %}
{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
+ {{ webarea_contact_link }}
{% endset %}
{% set admin_info %}
@@ -80,7 +99,6 @@
'has_header': true,
'has_footer': has_footer,
'has_sidenav': true,
- 'header_info': header_info,
'contact_link': contact_link,
'title': label,
'admin_info': admin_info,
@@ -93,12 +111,12 @@
{% include '@templates/detail-pages/page.twig' with {
'has_header': true,
'has_footer': has_footer,
- 'header_info': header_info,
'contact_link': contact_link,
'title': label,
'admin_info': admin_info,
'show_admin_info': show_admin_info,
'body': body,
'footer': footer,
+ 'is_narrow': true,
} %}
{% endif %}
diff --git a/services/drupal/web/themes/epa_theme/templates/content/node--perspective--full.html.twig b/services/drupal/web/themes/epa_theme/templates/content/node--perspective--full.html.twig
index 429aeb92ba..525a0b88fc 100644
--- a/services/drupal/web/themes/epa_theme/templates/content/node--perspective--full.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/content/node--perspective--full.html.twig
@@ -11,22 +11,44 @@
not node.isPublished() ? 'is-unpublished',
] %}
-{% set sidenav = drupal_region('sidebar') %}
-{% set display_sidenav = false %}
-{% if sidenav|render|striptags('
')|trim %}
- {% set display_sidenav = true %}
+{# @see epa_theme_preprocess_node__perspective__full() #}
+{% if subjects or more_link %}
+ {% set related_info %}
+
+ {% endset %}
{% endif %}
+{% set sidenav %}
+ {{ drupal_region('sidebar') }}
+
+ {% include '@components/box/box--related-links/box--related-links.twig' with {
+ 'modifier_classes': 'margin-y-4',
+ 'content': related_info,
+ 'title': {
+ 'tag': 'h2',
+ 'text': 'Related Links'|t,
+ },
+ } only %}
+{% endset %}
+
+{% set display_sidenav = true %}
+
{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'Perspectives'|t,
- } %}
+ {{ drupal_entity('block', 'epa_breadcrumbs', check_access=false) }}
{% endset %}
{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
+ {{ webarea_contact_link }}
{% endset %}
{% set admin_info %}
diff --git a/services/drupal/web/themes/epa_theme/templates/content/node--public-notice--full.html.twig b/services/drupal/web/themes/epa_theme/templates/content/node--public-notice--full.html.twig
index 660a2ee493..0b2ada6c08 100644
--- a/services/drupal/web/themes/epa_theme/templates/content/node--public-notice--full.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/content/node--public-notice--full.html.twig
@@ -20,15 +20,12 @@
{% endif %}
{% set header_info %}
- {% if nav_style == 'sidebar_navigation' %}
- {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: false,shortname: true}}) }}
- {% else %}
- {{ node.field_hublinks|view({type: 'web_areas_homepage_link_formatter', settings: {}}) }}
- {% endif %}
+ {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: false,shortname: true}}) }}
+ {{ drupal_entity('block', 'epa_breadcrumbs', check_access=false) }}
{% endset %}
{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
+ {{ webarea_contact_link }}
{% endset %}
{% set admin_info %}
@@ -117,5 +114,6 @@
'show_admin_info': show_admin_info,
'body': body,
'footer': footer,
+ 'is_narrow': true,
} %}
{% endif %}
diff --git a/services/drupal/web/themes/epa_theme/templates/content/node--regulation--full.html.twig b/services/drupal/web/themes/epa_theme/templates/content/node--regulation--full.html.twig
index 736e569d8d..e5572d41a6 100644
--- a/services/drupal/web/themes/epa_theme/templates/content/node--regulation--full.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/content/node--regulation--full.html.twig
@@ -20,15 +20,13 @@
{% endif %}
{% set header_info %}
- {% if nav_style == 'sidebar_navigation' %}
- {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: false,shortname: true}}) }}
- {% else %}
- {{ node.field_hublinks|view({type: 'web_areas_homepage_link_formatter', settings: {}}) }}
- {% endif %}
+ {{ node.entitygroupfield|view({type: 'group_homepage_node_formatter', settings: {link: false,shortname: true}}) }}
+ {{ drupal_entity('block', 'epa_breadcrumbs', check_access=false) }}
{% endset %}
{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
+{# {{ drupal_entity('block', 'webareaheader', check_access=false) }}#}
+ {{ webarea_contact_link }}
{% endset %}
{% set admin_info %}
diff --git a/services/drupal/web/themes/epa_theme/templates/content/node--speeches--full.html.twig b/services/drupal/web/themes/epa_theme/templates/content/node--speeches--full.html.twig
index 04aeff02ba..11e4b91057 100644
--- a/services/drupal/web/themes/epa_theme/templates/content/node--speeches--full.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/content/node--speeches--full.html.twig
@@ -11,13 +11,37 @@
not node.isPublished() ? 'is-unpublished',
] %}
-{% set sidenav = drupal_region('sidebar') %}
+{% set related_info %}
+
+{% endset %}
-{% set display_sidenav = false %}
+{% set sidenav %}
+ {{ drupal_region('sidebar') }}
+
+ {% include '@components/box/box--related-links/box--related-links.twig' with {
+ 'modifier_classes': 'margin-y-4',
+ 'content': related_info,
+ 'title': {
+ 'tag': 'h2',
+ 'text': 'Related Links'|t,
+ },
+ } only %}
+{% endset %}
-{% if sidenav|render|striptags('')|trim %}
- {% set display_sidenav = true %}
-{% endif %}
+{% set display_sidenav = true %}
{% set header_info %}
{% include '@components/web-area-title/web-area-title.twig' with {
@@ -26,7 +50,7 @@
{% endset %}
{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
+ {{ webarea_contact_link }}
{% endset %}
{% set admin_info %}
@@ -59,18 +83,6 @@
{% endif %}
{% endif %}
-{% set related %}
-
- {% if content.entitygroupfield|field_value -%}
- {{ content.entitygroupfield }}
- {%- endif -%}
- {%- if content.field_video|field_value -%}
- Watch the Event
- {%- endif -%}
- {{- content.field_related_information }}
-
-{% endset %}
-
{% set author_names %}
{% for term in node.field_authors -%}
{% set tid = term.entity.field_author.target_id %}
@@ -80,17 +92,6 @@
{% endset %}
{% set body %}
-
- {{ content.field_authors }}
- {% include '@components/box/box--related-info/box--related-info.twig' with {
- 'modifier_classes': '',
- 'title': {
- 'tag': 'div',
- 'text': 'Related Information',
- },
- 'content': related,
- } only %}
-
{{ author_names }}
{{ content.field_release|field_value }} {{ content.field_text_location|field_value }}
{{ content.field_paragraphs|field_value }}
@@ -103,10 +104,8 @@
{% if display_sidenav %}
{% include '@templates/detail-pages/page-with-sidenav.twig' with {
- 'has_header': true,
'has_footer': has_footer,
'has_sidenav': true,
- 'header_info': header_info,
'contact_link': contact_link,
'title': label,
'admin_info': admin_info,
diff --git a/services/drupal/web/themes/epa_theme/templates/content/node--web-area--full.html.twig b/services/drupal/web/themes/epa_theme/templates/content/node--web-area--full.html.twig
index 1f355d4cab..6653a676e5 100644
--- a/services/drupal/web/themes/epa_theme/templates/content/node--web-area--full.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/content/node--web-area--full.html.twig
@@ -17,7 +17,8 @@
{% endset %}
{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
+{# {{ drupal_entity('block', 'webareaheader', check_access=false) }}#}
+ {{ webarea_contact_link }}
{% endset %}
{% set admin_info %}
diff --git a/services/drupal/web/themes/epa_theme/templates/field/field--field-hublinks.html.twig b/services/drupal/web/themes/epa_theme/templates/field/field--field-hublinks.html.twig
deleted file mode 100644
index 7080300616..0000000000
--- a/services/drupal/web/themes/epa_theme/templates/field/field--field-hublinks.html.twig
+++ /dev/null
@@ -1,22 +0,0 @@
-{#
-/**
- * @file
- * Theme override for a field.
- */
-#}
-
-{% set links = [] %}
-
-{% for item in items %}
- {% set links = links|merge([
- {
- 'text': item.content['#title'],
- 'url': item.content['#url'],
- }
- ]) %}
-{% endfor %}
-
-{% include '@components/hublinks/hublinks.twig' with {
- 'title': 'Related Topics'|t,
- 'links': links,
-} %}
diff --git a/services/drupal/web/themes/epa_theme/templates/field/field--field-press-office.html.twig b/services/drupal/web/themes/epa_theme/templates/field/field--field-press-office.html.twig
index 66dd4f428d..33dfce37e4 100644
--- a/services/drupal/web/themes/epa_theme/templates/field/field--field-press-office.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/field/field--field-press-office.html.twig
@@ -43,7 +43,6 @@
'field--name-' ~ field_name|clean_class,
'field--type-' ~ field_type|clean_class,
'field--label-' ~ label_display,
- 'hublinks',
] %}
{% set attributes = attributes.addClass(classes) %}
@@ -55,5 +54,5 @@
'label_element': 'div',
'label': label,
'field_items': items,
- 'modifier_classes': 'field--tight hublinks field--alternate-font',
+ 'modifier_classes': 'field--tight field--alternate-font',
} %}
diff --git a/services/drupal/web/themes/epa_theme/templates/field/field--node--entitygroupfield.html.twig b/services/drupal/web/themes/epa_theme/templates/field/field--node--entitygroupfield.html.twig
index fbccc3a506..c369259fa3 100644
--- a/services/drupal/web/themes/epa_theme/templates/field/field--node--entitygroupfield.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/field/field--node--entitygroupfield.html.twig
@@ -4,9 +4,3 @@
* Theme override for a field.
*/
#}
-
-{% for item in items %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': item.content,
- } %}
-{% endfor %}
diff --git a/services/drupal/web/themes/epa_theme/templates/field/field--node--field-subjects--news-release.html.twig b/services/drupal/web/themes/epa_theme/templates/field/field--node--field-subjects--news-release.html.twig
new file mode 100644
index 0000000000..67acd7ee0e
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/templates/field/field--node--field-subjects--news-release.html.twig
@@ -0,0 +1,10 @@
+{#
+/**
+ * @file
+ * Theme override for a field.
+ */
+#}
+
+{% for item in items %}
+ {{ item.content }}
+{% endfor %}
diff --git a/services/drupal/web/themes/epa_theme/templates/field/field--node--field-subjects--perspective.html.twig b/services/drupal/web/themes/epa_theme/templates/field/field--node--field-subjects--perspective.html.twig
index f1e0e6c430..67acd7ee0e 100644
--- a/services/drupal/web/themes/epa_theme/templates/field/field--node--field-subjects--perspective.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/field/field--node--field-subjects--perspective.html.twig
@@ -4,8 +4,7 @@
* Theme override for a field.
*/
#}
-
- {% for item in items %}
- {{ item.content }}
- {% endfor %}
-
+
+{% for item in items %}
+ {{ item.content }}
+{% endfor %}
diff --git a/services/drupal/web/themes/epa_theme/templates/field/field--node--field-subjects--speeches.html.twig b/services/drupal/web/themes/epa_theme/templates/field/field--node--field-subjects--speeches.html.twig
new file mode 100644
index 0000000000..67acd7ee0e
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/templates/field/field--node--field-subjects--speeches.html.twig
@@ -0,0 +1,10 @@
+{#
+/**
+ * @file
+ * Theme override for a field.
+ */
+#}
+
+{% for item in items %}
+ {{ item.content }}
+{% endfor %}
diff --git a/services/drupal/web/themes/epa_theme/templates/navigation/breadcrumb.html.twig b/services/drupal/web/themes/epa_theme/templates/navigation/breadcrumb.html.twig
new file mode 100644
index 0000000000..2488da6739
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/templates/navigation/breadcrumb.html.twig
@@ -0,0 +1,11 @@
+{#
+ /**
+ * @file
+ * Theme override for the breadcrumb menu.
+ *
+ */
+#}
+
+{% include '@components/breadcrumb/breadcrumb.twig' with {
+ 'hide_title': true,
+} %}
diff --git a/services/drupal/web/themes/epa_theme/templates/navigation/menu--group-menu.html.twig b/services/drupal/web/themes/epa_theme/templates/navigation/menu--group-menu.html.twig
new file mode 100644
index 0000000000..1098fa80ca
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/templates/navigation/menu--group-menu.html.twig
@@ -0,0 +1,36 @@
+{#
+ /**
+ * @file
+ * Theme override for Menu.
+ *
+ */
+#}
+
+{% if items %}
+
+
+
+{% endif %}
diff --git a/services/drupal/web/themes/epa_theme/templates/views/views-view--search-faqs.html.twig b/services/drupal/web/themes/epa_theme/templates/views/views-view--search-faqs.html.twig
index 32e2c86e67..185cbd7073 100644
--- a/services/drupal/web/themes/epa_theme/templates/views/views-view--search-faqs.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/views/views-view--search-faqs.html.twig
@@ -5,16 +5,6 @@
*/
#}
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'Frequent Questions'|t,
- } %}
-{% endset %}
-
-{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
-{% endset %}
-
{% set admin_info %}
{{ drupal_block('system_messages_block', wrapper=false) }}
{{ drupal_block('local_tasks_block', wrapper=false) }}
@@ -69,8 +59,6 @@
{% include '@templates/listing-pages/listing-page.twig' with {
'has_header': true,
'has_sidenav': true,
- 'header_info': header_info,
- 'contact_link': contact_link,
'title': view.title,
'contextual_links': title_suffix.contextual_links,
'admin_info': admin_info,
diff --git a/services/drupal/web/themes/epa_theme/templates/views/views-view--search-news-releases.html.twig b/services/drupal/web/themes/epa_theme/templates/views/views-view--search-news-releases.html.twig
index 47b007bbec..b18abccc2f 100644
--- a/services/drupal/web/themes/epa_theme/templates/views/views-view--search-news-releases.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/views/views-view--search-news-releases.html.twig
@@ -5,16 +5,6 @@
*/
#}
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'News Releases'|t,
- } %}
-{% endset %}
-
-{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
-{% endset %}
-
{% set admin_info %}
{{ drupal_block('system_messages_block', wrapper=false) }}
{{ drupal_block('local_tasks_block', wrapper=false) }}
@@ -74,8 +64,6 @@
{% include '@templates/listing-pages/listing-page.twig' with {
'has_header': true,
'has_sidenav': true,
- 'header_info': header_info,
- 'contact_link': contact_link,
'title': view.title,
'contextual_links': title_suffix.contextual_links,
'admin_info': admin_info,
diff --git a/services/drupal/web/themes/epa_theme/templates/views/views-view--search-perspectives.html.twig b/services/drupal/web/themes/epa_theme/templates/views/views-view--search-perspectives.html.twig
index 92198efec7..f64402f097 100644
--- a/services/drupal/web/themes/epa_theme/templates/views/views-view--search-perspectives.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/views/views-view--search-perspectives.html.twig
@@ -5,16 +5,6 @@
*/
#}
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'Perspectives'|t,
- } %}
-{% endset %}
-
-{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
-{% endset %}
-
{% set admin_info %}
{{ drupal_block('system_messages_block', wrapper=false) }}
{{ drupal_block('local_tasks_block', wrapper=false) }}
@@ -72,8 +62,6 @@
{% include '@templates/listing-pages/listing-page.twig' with {
'has_header': true,
'has_sidenav': true,
- 'header_info': header_info,
- 'contact_link': contact_link,
'title': view.title,
'contextual_links': title_suffix.contextual_links,
'admin_info': admin_info,
diff --git a/services/drupal/web/themes/epa_theme/templates/views/views-view--search-public-notices.html.twig b/services/drupal/web/themes/epa_theme/templates/views/views-view--search-public-notices.html.twig
index 3e44792cfc..c06a25bd56 100644
--- a/services/drupal/web/themes/epa_theme/templates/views/views-view--search-public-notices.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/views/views-view--search-public-notices.html.twig
@@ -5,16 +5,6 @@
*/
#}
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'Public Notices'|t,
- } %}
-{% endset %}
-
-{% set contact_link %}
- {{ drupal_entity('block', 'webareaheader', check_access=false) }}
-{% endset %}
-
{% set admin_info %}
{{ drupal_block('system_messages_block', wrapper=false) }}
{{ drupal_block('local_tasks_block', wrapper=false) }}
@@ -73,8 +63,6 @@
{% include '@templates/listing-pages/listing-page.twig' with {
'has_header': true,
'has_sidenav': true,
- 'header_info': header_info,
- 'contact_link': contact_link,
'title': view.title,
'contextual_links': title_suffix.contextual_links,
'admin_info': admin_info,
diff --git a/services/drupal/web/themes/epa_theme/templates/views/views-view--search-speeches-and-remarks.html.twig b/services/drupal/web/themes/epa_theme/templates/views/views-view--search-speeches-and-remarks.html.twig
index 2152d9b5f4..c0a73bdae1 100644
--- a/services/drupal/web/themes/epa_theme/templates/views/views-view--search-speeches-and-remarks.html.twig
+++ b/services/drupal/web/themes/epa_theme/templates/views/views-view--search-speeches-and-remarks.html.twig
@@ -5,12 +5,6 @@
*/
#}
-{% set header_info %}
- {% include '@components/web-area-title/web-area-title.twig' with {
- 'text': 'Speeches and Remarks'|t,
- } %}
-{% endset %}
-
{% set contact_link %}
{{ drupal_entity('block', 'webareaheader', check_access=false) }}
{% endset %}
@@ -72,7 +66,6 @@
{% include '@templates/listing-pages/listing-page.twig' with {
'has_header': true,
'has_sidenav': true,
- 'header_info': header_info,
'contact_link': contact_link,
'title': view.title,
'contextual_links': title_suffix.contextual_links,
diff --git a/services/drupal/web/themes/epa_theme/theme-settings.php b/services/drupal/web/themes/epa_theme/theme-settings.php
new file mode 100644
index 0000000000..36a80c564a
--- /dev/null
+++ b/services/drupal/web/themes/epa_theme/theme-settings.php
@@ -0,0 +1,31 @@
+ 'details',
+ '#title' => t('Breadcrumb'),
+ '#open' => TRUE,
+ ];
+
+ $form['breadcrumb']['include_current_page_in_breadcrumb'] = [
+ '#type' => 'checkbox',
+ '#title' => t('Include current page in breadcrumb'),
+ '#default_value' => theme_get_setting('include_current_page_in_breadcrumb') ?? TRUE,
+ ];
+}