- 🇨🇦Canada mgifford Ottawa, Ontario
I think this most closely aligns with https://www.w3.org/TR/UNDERSTANDING-WCAG20/content-structure-separation-...
Currently, the Umami theme checks for empty regions by doing this:
{% if page.header|render|striptags|trim is not empty %}
The idea behind using the striptags
filter is that it would leave any plain text content produced by blocks and thus show regions that are not empty.
But the striptags
filter also removes HTML replaced elements such as img
, video
, iframe
, audio
, canvas
, etc. That filter also removes Drupal's <drupal-render-placeholder>
used by Big Pipe.
That means the current code removes A LOT of valid content. If Umami were a regular theme (and not a demo theme for a specific set of demo content), this would be a major bug.
Because of the stripped content, this is NOT a duplicate of 🌱 [meta] Themes improperly check renderable arrays when determining visibility Needs work but that issue is definitely related.
TODO: Document how to see this bug with the Umami content. Do we need to add additional content? Or is it visible right out of the box?
Patch in #35 reworks the page template so that we don't need to do the if checks. Any thoughts on this approach?
Patch in #35 adds some new wrapper divs.
TBD
None
TBD
From issue:
==============
+++ b/core/profiles/demo_umami/themes/umami/templates/layout/page.html.twig
@@ -0,0 +1,132 @@
+ {% if page.header|render|striptags|trim is not empty %}
...
+ {% if page.tabs|render|striptags|trim is not empty %}
...
+ {% if page.banner_top|render|striptags|trim is not empty %}
...
+ {% if page.breadcrumbs|render|striptags|trim is not empty %}
...
+ {% if page.page_title|render|striptags|trim is not empty %}
...
+ {% if page.sidebar|render|striptags|trim is not empty %}
...
+ {% if page.footer|render|striptags|trim is not empty %}
...
+ {% if page.bottom|render|striptags|trim is not empty %}
Is this the only way we can do this? Surely we can do something smarter in preprocessing?
==============
If we just print
{% if page.tabs %}
{{ pagetabs }}
{% endif %}
We get empty regions printed on every page that there is no block in that region for. So on a views page, we'll have <div class="region-tabs"></div>
This is a known issue in Drupal core, so we can't fix it until that is fixed.
🌱
[meta] Themes improperly check renderable arrays when determining visibility
Needs work
Needs work
11.0 🔥
It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.
Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I think this most closely aligns with https://www.w3.org/TR/UNDERSTANDING-WCAG20/content-structure-separation-...