Skip to content

Commit

Permalink
Distinct View All IDs for screen readers (Shopify#1733)
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaz93 authored and Thomas Timmers committed Aug 29, 2022
1 parent b085adf commit 273a109
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions sections/collection-list.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
<div class="collection-list-wrapper page-width isolate{% if show_mobile_slider %} page-width-desktop{% endif %}{% if section.settings.title == blank %} no-heading{% endif %}{% if section.settings.show_view_all == false or section.blocks.size > collections.size %} no-mobile-link{% endif %} section-{{ section.id }}-padding">
{%- unless section.settings.title == blank -%}
<div class="title-wrapper-with-link{% if show_mobile_slider %} title-wrapper--self-padded-tablet-down{% else %} title-wrapper--self-padded-mobile{% endif %} title-wrapper--no-top-margin">
<h2 class="collection-list-title {{ section.settings.heading_size }}">{{ section.settings.title | escape }}</h2>
<h2 id="SectionHeading-{{ section.id }}" class="collection-list-title {{ section.settings.heading_size }}">{{ section.settings.title | escape }}</h2>

{%- if section.settings.show_view_all and show_mobile_slider -%}
<a href="{{ routes.collections_url }}" class="link underlined-link large-up-hide">{{ 'sections.collection_list.view_all' | t }}</a>
<a href="{{ routes.collections_url }}" id="ViewAll-{{ section.id }}" class="link underlined-link large-up-hide" aria-labelledby="ViewAll-{{ section.id }} SectionHeading-{{ section.id }}">{{ 'sections.collection_list.view_all' | t }}</a>
{%- endif -%}
</div>
{%- endunless -%}
Expand Down Expand Up @@ -71,7 +71,7 @@

{%- if section.settings.show_view_all and section.blocks.size < collections.size -%}
<div class="center collection-list-view-all{% if show_mobile_slider %} small-hide medium-hide{% endif %}">
<a href="{{ routes.collections_url }}" class="button">{{ 'sections.collection_list.view_all' | t }}</a>
<a href="{{ routes.collections_url }}" class="button" id="ViewAllButton-{{ section.id }}" aria-labelledby="ViewAllButton-{{ section.id }} SectionHeading-{{ section.id }}">{{ 'sections.collection_list.view_all' | t }}</a>
</div>
{%- endif -%}
</div>
Expand Down
4 changes: 2 additions & 2 deletions sections/featured-blog.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<div class="page-width-desktop isolate{% if posts_displayed < 3 %} page-width-tablet{% endif %} section-{{ section.id }}-padding">
{%- unless section.settings.heading == blank -%}
<div class="title-wrapper-with-link{% if posts_displayed > 2 %} title-wrapper--self-padded-tablet-down{% else %} title-wrapper--self-padded-mobile{% endif %} title-wrapper--no-top-margin">
<h2 class="blog__title {{ section.settings.heading_size }}">{{ section.settings.heading | escape }}</h2>
<h2 id="SectionHeading-{{ section.id }}" class="blog__title {{ section.settings.heading_size }}">{{ section.settings.heading | escape }}</h2>

{%- if section.settings.blog != blank and section.settings.show_view_all and section.settings.post_limit < section.settings.blog.articles_count -%}
<a href="{{ section.settings.blog.url }}"
Expand Down Expand Up @@ -73,7 +73,7 @@

{%- if section.settings.show_view_all and section.settings.post_limit < section.settings.blog.articles_count -%}
<div class="blog__view-all center small-hide medium-hide">
<a href="{{ section.settings.blog.url }}" class="blog__button button">
<a href="{{ section.settings.blog.url }}" id="ViewAll-{{ section.id }}" class="blog__button button" aria-labelledby="ViewAll-{{ section.id }} SectionHeading-{{ section.id }}">
{{ 'sections.featured_blog.view_all' | t }}
</a>
</div>
Expand Down

0 comments on commit 273a109

Please sign in to comment.