- Issue created by @smustgrave
- @smustgrave opened merge request.
- Status changed to Needs review
almost 2 years ago 3:15pm 26 January 2023 - π¦πΊAustralia mingsong π¦πΊ
The ID provides the information where the tooltip comes from (which taxonomy term).
Agree with that there shouldn't be any duplicated ID. So I would suggest that use another attributes instead.
For example,
<span class="tx-tooltip-text" tooltip-term-data="{{ tooltip_id }}">
- Status changed to Needs work
almost 2 years ago 11:57pm 29 January 2023 - πΊπΈUnited States smustgrave
Like that idea will get to that this week.
- π¦πΊAustralia mingsong π¦πΊ
Thanks @Stephen.
Just a second thought, in some sites( use case), they might be not willing to expose term ids for security reason.
I don't know if it is over precaution.
Is there any way to add those information only for debug purpose? Something like debug mode of twig?
- πΊπΈUnited States smustgrave
Could add a config setting. Then in a preprocess hook pass a variable to the template to render the attribute or not.
Would require updating the schema and update function too.
- π¦πΊAustralia mingsong π¦πΊ
How about the twig dump() function?
https://twig.symfony.com/doc/3.x/functions/dump.htmlFor example,
<!-- tooltip_taxonomy {{ dump(tooltip_id) }} --> <span class="tx-tooltip-text">
- πΊπΈUnited States smustgrave
I've never deployed that before won't that render all the time?
I use that for just debugging.
- π¦πΊAustralia mingsong π¦πΊ
As the API document said
The dump function won't display anything if the debug option on the environment is not enabled (to avoid leaking debug information on a production server).
Also
The dump function is not available by default. You must add the \Twig\Extension\DebugExtension extension explicitly when creating your Twig environment.
Not sure if Drupal core adds that extension already. The idea is provides a way for developers to get the debug information if needed.
Local development environment is not a Drupal contribute module needs to look after. So I believe providing the dump function in the template is good enough for that. - Status changed to Needs review
almost 2 years ago 12:38am 1 February 2023 -
Mingsong β
committed edd5ee3e on 2.x authored by
smustgrave β
Issue #3336686: Accessibility issue duplicate ids
-
Mingsong β
committed edd5ee3e on 2.x authored by
smustgrave β
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 9:39am 20 April 2023 Hi, effectively, for accessibility, I need to use tooltip_id like an ID, so if a term appear more than 1 time, there are duplicate IDs.
I use aria-describedby on the parent span and id on the tooltip span.
For exemple :
<span role="tooltip" aria-describedby="{{ tooltip_id }}" class="tx-tooltip" tabindex="0"> {{ term_name }} <span id="{{ tooltip_id }}" class="tx-tooltip-text"> {{ description }} </span> </span>
I need all of this to have a clean accessibility code.
Is it possible to add an increment at the end of tooltip_id var after every use on a term ? Or something else ?
Thx for your help