Skip to content

Commit

Permalink
[#380] Added navigation name to support aria-label for <nav> element (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
febdao authored Nov 11, 2024
1 parent b86df8b commit 5c9f5eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/themes/contrib/civictheme/includes/menu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ function _civictheme_preprocess_block__navigation(array &$variables): void {
$key = substr($menu_name, strlen('civictheme_'));
// Set menu theme as per footer theme.
$variables['theme'] = civictheme_get_theme_config_manager()->load('components.header.theme', CivicthemeConstants::HEADER_THEME_DEFAULT);
// Set name for aria-label of <nav> element.
$variables['name'] = strtr($key, '_navigation', '');
$variables['items'] = $variables['content']['#items'] ?? [];
$variables['dropdown'] = civictheme_get_theme_config_manager()->load(sprintf('components.navigation.%s.dropdown', $key), $menu_name === 'civictheme_primary_navigation' ? CivicthemeConstants::NAVIGATION_DROPDOWN_DRAWER : CivicthemeConstants::NAVIGATION_DROPDOWN_DROPDOWN);
$variables['dropdown_columns'] = civictheme_get_theme_config_manager()->load(sprintf('components.navigation.%s.dropdown_columns', $key), 4);
Expand Down

0 comments on commit 5c9f5eb

Please sign in to comment.