sitemap a11y improvements#5312
Conversation
Related FixesWhile working on this, I found the following bugs and elements that were confusing to users and fixed them along the way. cms/index.html
note: this follows the explanation given on the cms/nav.html page where it describes how to enter navigation links
Key Features.Front of house footer links to SitemapsThese use a template_tag to go to the most relevant sitemap. Most of this is intuitive:
But some less so...
Which Static Pages?Always-present
These appear regardless of any nav flag. for example the 'home' page can be disabled in the custom navigation, but unlike other disabled pages, would always exist! Built-in nav pages (journal-only)mirrors each nav_* flag on the Journal model:
Plus journal settings:
CMS custom nav pagesNavigationItems with /site/ links (flat nav and subnav treated identically), plus non-CMS custom nav items. News GateNews suppression post-processing still applies to both press and journal to handle any custom nav items pointing to /news/ when no items exist. Handling of CMS pagesCMS pages are only included if they are in the Navigation. This is because we want to use the Navigation + Index pages (e.g. Issues) with the Sitemap to demonstrate compliance with WCAG Multiple Ways . So if a CMS page isn't in the navigation, then it isn't in use. Note this is how some installs are using CMS pages in order to have draft or backup pages by not putting them in the navigation. To make this clearer in the manager, I have included an additional column next to each CMS page, that shows where it is in the navigation (or that it isn't there). CMS pages that have no content, will 404, so these are also filtered out by the sitemap. The CMS page name is not used in the sitemap as the label for the link, instead the label in the navigation is used, this is for consistency as it is the label presented to users. Handling of Nav linksExternal links are ignored, as they are not for the site. For journals and repositories, press links are ignored, as they will be on the press site map Orphaned Nav pages are also ignored, this is where a page was added as a sub-navigation, then the parent navigation item was deleted, but the sub-nav itself was not deleted. These do not show up in the navigation, but will show up in a database query, so are specifically filtered out. Ensuring Unique Contextual LInksFor WCAG compliance, it is important that link text is unique on the page. We handle this in two stages. First each URL should only appear once on a page (deduplication) and second where different URLs have the same text label, we disambiguate them by adding ValidationAs per Sitemaps.org Protocol. This required a change in the structure of the sitemaps from what had been agreed during Backlog refinement. We cannot have a mix of links and child sitemaps, so the static links have been moved into their own child sitemap. TestingAdded a [redacted] tonne of tests - to guard against duplicates or missing items in the sitemaps in future. Docs
|
77a482e to
ea56f0e
Compare
closes #5170