Skip link not working on About pages
What
The skip link does not allow you to skip to the main content on the /help pages, with the exception of /help/cookies
The JavaScript error below is thrown in the console:
Error starting GovukSkipLink component JS
ElementError: govuk-skip-link
Target content (`id="content"`) not found
Possible fix
We should be able to fix this by adding <main id="content"> to the _body_with_related_links.html.erb view template, similar to the approach used in _base_page.html.erb
Good spot @MartinJJones. I think this might relate to some of recent app consolidation work, going to ping @KludgeKML to check.
Yes, that's correct - when the help pages got moved over (they were the first set to be moved), we didn't notice that government-frontend pages all had an implicit main element in the layout, but frontend pages all supplied their own main element. I'll write up a card to get this added.
Thanks @andysellick @KludgeKML 👍
Closing this issue, as it appears to be resolved. I've checked several help pages (excluding /help/cookies), and they all have id="content" on the main element. The skip links correctly navigate to the first interactive element within the main container as well.