Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow anchor-js links to be added to headers via a class or other means #293

Open
imcbride opened this issue Apr 2, 2020 · 4 comments
Open

Comments

@imcbride
Copy link
Member

imcbride commented Apr 2, 2020

Currently these are only added when the table of contents feature is enabled. This is a low priority.

@zebapy
Copy link
Contributor

zebapy commented Apr 2, 2020

Are there specific components/headings you intend to add the IDs to?

If we enabled the automatic IDs whether or not a TOC is on page, would that solve it? They would only be applied to content we already deemed appropriate for TOC navigation (anything with data-digest-content attribute).

@imcbride
Copy link
Member Author

imcbride commented Apr 2, 2020

This would include a rather large list of existing components.

web/themes/custom/middlebury_theme/templates/paragraph--profiles.html.twig:7:<div class="section paragraph--profile-list" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--event-schedule.html.twig:1:<div class="schedule paragraph--schedule" data-digest-content>
web/themes/custom/middlebury_theme/templates/views-view--all-groups.html.twig:1:<div class="js-offices-region" id="midd-offices" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--rss-feed.html.twig:2:<section class="section paragraph--rss-feed" aria-labelledby="midd-rss-feed-label-{{ id }}" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--text.html.twig:2:  <div class="typography paragraph--text" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--image-with-text.html.twig:2:  <div class="paragraph--image-text media-object{% if paragraph.field_alignment.0.value is not empty and paragraph.field_alignment.0.value == 'right' %} media-object--right{% endif %}" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--text-columns.html.twig:2:  <div class="paragraph--two-col-text" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--story-blocks.html.twig:1:<section class="paragraph--quad-story" aria-labelledby="midd-profile-spotlight-label" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--quick-links.html.twig:3:  <div class="section paragraph--link-list" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--faqs.html.twig:1:<section class="section paragraph--faq" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--video-group.html.twig:4:    <div class="section paragraph paragraph--expand" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--chart-map.html.twig:2:<div class="paragraph--chart" id="midd-map-{{ id }}" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--its-ticket-statistics.html.twig:1:<div class="paragraph--chart" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--latest-news.html.twig:2:<section class="section paragraph" aria-labelledby="midd-latest-news-label-{{ id }}" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--25live-widget.html.twig:7:<div class="section paragraph--profile-list" data-digest-content>
web/themes/custom/middlebury_theme/templates/paragraph--chart-group.html.twig:1:<div class="paragraph--chart" data-digest-content>

@zebapy
Copy link
Contributor

zebapy commented Apr 2, 2020

I'm not sure what downsides turning them all on would be. If there's an accessibility issue with them (unsure if the focusable links for each heading is bloat?), we should fix that for TOC links too.

zebapy added a commit that referenced this issue Jun 24, 2020
@zebapy
Copy link
Contributor

zebapy commented Jun 24, 2020

@imcbride I made it so any digest-content h2 will have the anchor link automatically added whether or not there's a table of contents nav on page. Is that suitable enough for this ask?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants