-
Notifications
You must be signed in to change notification settings - Fork 1
4.x: Refactor footer menus so that they do not render elements if empty, r… #1114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.x
Are you sure you want to change the base?
Conversation
…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.
|
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. |
|
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
left a comment
There was a problem hiding this 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:
- Get a local copy of drupal.webtheme running on my local dev running the 4.x branch
- Deleted the items in the footer menu third menu to make it a blank menu
- Switched the theme repo to the 1113-empty-footer-menus-use branch
- Cleared cache
- 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
left a comment
There was a problem hiding this 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!
…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