Issue: Link missing a text alternative - Carousel
This article specifically pertains to an issue found in the legacy templates with the carousel.
Issue | Conformance | Description |
---|---|---|
Link missing a text alternative | A | Links should always have a text alternative. The link text can be inserted into the HTML — it does not need to be visible to pass this check. |
Links represented by images or icons can be problematic for visitors who are blind or have low vision. The text alternative should describe the link's purpose — or what visitors can expect to find after they click it. More than likely this issue is due to the carousel navigation elements used to activate the slides in legacy templates.
This fix requires editing HTML Code and depending on the template version, may be handled centrally.
Good News! You only need to make this change once. This change will propagate to every page on your site that uses the carousel after you re-publish the pages.
It is recommended that you work with two browser windows open (Cascade CMS and Siteimprove) as you complete this process.
Locate the code to fix
When viewing a page report in Siteimprove, the default view shows page content. When you click on the
Show HTML button, Siteimprove will highlight the issue location in the code.
Take note of the highlighted code in your browser window. The code highlighted indicates that carousel indicators are missing a text alternative.
Adding a text alternative for the carousel indicators is set in the carousel format in the site template.
Instructions
In Cascade CMS, go to the page identified in the page report. In the sample above, the “presentation template” page is selected.
Click the …more drop down menu and select Show Regions. The Region Assignments sidebar will appear.
The Region Assignments provide a map of each region created in a template. We have already identified the text alternative issue in the carousel format. Click Carousel. The format “carousel” appears.
Click the carousel format to go to the asset in your site.
Note the breadcrumb trail for the carousel format above. It is located inside the _cascade folder for your site. Files in the _cascade folder control a specific region on every page in your site. Making a change to this asset will require you to re-publish your pages in your site for the changes to take effect.
Add the text alternative for the mobile-nav block
On the Velocity Format: carousel page, click Edit. The advanced editor window will open.
On or around line 36 of the code, locate the
<!--Controls -->
comment in the Cascade CMS editor.Copy the aria-label from the code block below and add it to both
<span>
tags.aria-hidden="true"
The <span>
tags should now look like this:
Next, you will add an additional
<span>
that will provide instructions to screen readers. Copy the code from the block below and paste it after the closing</span>
tag with the "icon-prev" class.<span class="sr-only">Previous</span>
Copy the code from the block below and paste it after the closing
</span>
tag with the "icon-next" class.<span class="sr-only">Next</span>
The final result should look like this:
Click Preview Draft and then Submit to save to Cascade CMS.
After you have successfully saved the velocity format, go to the page in Cascade CMS that was identified in the Siteimprove page report and publish the page.
Verify successful remediation
Return to the Siteimprove to recheck the page.
You can recheck the page from the page report window or the list of pages in the issue overview page.
When you return to the issues overview page in Siteimprove, the page you fixed will no longer be listed for this particular issue.
On the page report window, if you have successfully corrected all issues on that page, you will see a “Great Job! All occurrences on this page have been fixed” badge.