- Issue created by @artatac
- 🇮🇳India mehul.gada Mumbai
Hi @artatac
"tippy" is not a standard HTML tag. I guess you are trying to use "tippy.js" library to create nice-looking tooltips and it works on the specific class ("tippy-tooltip-text" in your case). So, why not use a span tag instead?
Drupal is doing XSS filtering to skip harmful text and that's why tippy tag is getting stripped. This tag list is maintained in the core file - web/core/lib/Drupal/Component/Utility/Xss.php. Modifying this file is not recommended as you need to patch it. Alternatively, you can create a twig file in your custom theme to modify the field output. You can create a specific twig file with the name views-view-field--[view_machine_name]--[page OR block machine_name]--[field-machine_name].html.twig and add your custom HTML tags. But the best option will be to use the span tag instead as that would mean no custom code and not patching.
- Status changed to Closed: works as designed
almost 2 years ago 2:51pm 20 March 2023 - 🇳🇱Netherlands Lendude Amsterdam
Per #2 this indeed works as designed, good suggestions given there.
- 🇬🇧United Kingdom artatac
Really good advice thank you. So would
<span class="tippy-tooltip-text"{{ body_1 }} ">{{ field_rank }}</span>
Do what I need? The reason I wish to use it is it seems to give pop ups on touch screens which is great :-)