Skip to content

Conversation

@robgasc
Copy link
Contributor

@robgasc robgasc commented Jan 23, 2026

…emove bonus block templates that are overriding a bootstrap template by directly replacing the offending template in our theme, and clear up nav element use to ensure major navs are using the element.

Addresses #1113

Testing steps

  1. Download an existing site.
  2. Compare the two menus between the local site and remove site.
  3. Ensure they are matching.
  4. Remove the existing footer menu items from the local site.
  5. Inspect the footer and verify no vestige of the footer menu elements remains.

…emove bonus block templates that are overriding a bootstrap template by directly replacing the offending template in our theme, and clear up nav element use to ensure major navs are using the element.
@robgasc
Copy link
Contributor Author

robgasc commented Jan 23, 2026

This is a fairly large refactor of the footer menu.

I tried to remove extra templates here by using a direct override of the bootstrap template, where for whatever reason bootstrap applies an h5 to blocks. It also removes the nav element altogether, and the use of aria-labels, as the menu blocks already have headings for their labels. This also results in a minor style change to move the margin bottom onto the footer-menus class instead of the nav, since it also bumps following elements down appropriately.

@robgasc robgasc added bug Something isn't working accessibility labels Jan 23, 2026
@robgasc robgasc marked this pull request as draft January 23, 2026 18:10
@robgasc robgasc marked this pull request as ready for review January 23, 2026 18:24
@robgasc robgasc changed the title Refactor footer menus so that they do not render elements if empty, r… 4.x: Refactor footer menus so that they do not render elements if empty, r… Jan 23, 2026
@trubach trubach linked an issue Jan 23, 2026 that may be closed by this pull request
@robgasc
Copy link
Contributor Author

robgasc commented Jan 23, 2026

This PR and its sibling will hide the container for menu 1 and 2, so if there is value in having the container, this will break that piece. For instance, adding a spacing between the 3/4 menu and the address area.

@trubach trubach self-requested a review January 28, 2026 21:44
Copy link
Contributor

@trubach trubach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing a WSOD error when I tested out this branch on my local dev against a copy of the drupal.webtheme website.

Steps I followed:

  1. Get a local copy of drupal.webtheme running on my local dev running the 4.x branch
  2. Deleted the items in the footer menu third menu to make it a blank menu
  3. Switched the theme repo to the 1113-empty-footer-menus-use branch
  4. Cleared cache
  5. Homepage throws WSOD (output below)

Here's the output of the error message:

The website encountered an unexpected error. Try again later.

Twig\Error\SyntaxError: Unexpected end of template in "themes/contrib/illinois_framework_theme/templates/region/region--footer.html.twig" at line 162. in Twig\TokenStream->next() (line 162 of /app/src/illinois_framework_theme/templates/region/region--footer.html.twig).
Twig\TokenParser\IfTokenParser->parse(Object) (Line: 224)
Twig\Parser->subparse(NULL, ) (Line: 104)
Twig\Parser->parse(Object) (Line: 558)
Twig\Environment->parse(Object) (Line: 589)
Twig\Environment->compileSource(Object) (Line: 131)
Drupal\Core\Template\TwigEnvironment->compileSource(Object) (Line: 408)
Twig\Environment->loadTemplate('__TwigTemplate_eefbbe4333df18c7b5ed22670d800c46', 'themes/contrib/illinois_framework_theme/templates/region/region--footer.html.twig') (Line: 370)
Twig\Environment->load('themes/contrib/illinois_framework_theme/templates/region/region--footer.html.twig') (Line: 33)
twig_render_template('themes/contrib/illinois_framework_theme/templates/region/region--footer.html.twig', Array) (Line: 348)
Drupal\Core\Theme\ThemeManager->render('region', Array) (Line: 546)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
Drupal\Core\Render\Renderer->render(Array) (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 229)
__TwigTemplate_738ce642dbe5d1219603ccf728096fbe->doDisplay(Array, Array) (Line: 402)
Twig\Template->yield(Array, Array) (Line: 358)
Twig\Template->display(Array) (Line: 373)
Twig\Template->render(Array) (Line: 51)
Twig\TemplateWrapper->render(Array) (Line: 33)
twig_render_template('themes/contrib/illinois_framework_theme/templates/layout/page--content-page.html.twig', Array) (Line: 348)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 490)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
Drupal\Core\Render\Renderer->render(Array) (Line: 484)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 103)
__TwigTemplate_6995afac8d7e5573e534f8b38c9db8b8->doDisplay(Array, Array) (Line: 402)
Twig\Template->yield(Array, Array) (Line: 358)
Twig\Template->display(Array) (Line: 373)
Twig\Template->render(Array) (Line: 51)
Twig\TemplateWrapper->render(Array) (Line: 33)
twig_render_template('themes/contrib/illinois_framework_theme/templates/layout/html.html.twig', Array) (Line: 348)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 490)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
Drupal\Core\Render\Renderer->render(Array) (Line: 158)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 637)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 153)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

@trubach trubach self-requested a review January 29, 2026 19:36
Copy link
Contributor

@trubach trubach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the changes on a copy of the drupal.webtheme site on my localdev and verified that the empty <nav> element no longer appears.

Approved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty footer menu nav elements, and their use

3 participants