Problem/Motivation
Tooltips now appear for the h2 h3 headings as well, with the font-size from the heading. How can I skip showing the tooltips for headings?
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | exclude tag test.gif | 75.82 KB | mingsong |
| #9 | Render result.png | 119.65 KB | mingsong |
| #9 | original content.png | 64.3 KB | mingsong |
| #9 | Drupal term.png | 63.96 KB | mingsong |
| #9 | CMS taxonomy.png | 68.8 KB | mingsong |
Issue fork tooltip_taxonomy-3381148
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mingsongThere is not h2 or h3 tag in the tooltip template.
https://git.drupalcode.org/project/tooltip_taxonomy/-/blob/2.1.1/templat...
I don't know where the tags you mentioned come from, maybe come from your theme?
Also there is a field setting to specify what tags are allowed for the tooltip.
Comment #3
mingsongComment #4
gaddman commentedI think this is referring to the tooltip inheriting the formatting of the text in which the taxonomy term is present. For example if the node text is bold (ie formatted as
<strong>) and contains the term my term:A sentence with my term in it.
then the tooltip text for 'my term' will be bold as well. Likewise for
h2and other heading levels.For the
<strong>example I added some CSS resets (also resets some other styles):Comment #5
gaddman commentedComment #6
smovs commentedComment #8
smovs commentedIndeed, tooltips are added to header tags like h1, h2, etc, inside the CKEditor can look odd.
I added a field to the Conditional form settings that allows users to add excluded tags, for which tooltips are not applied.
@mingsong Please review the MR
Comment #9
mingsongThanks @Sviatoslav.
I manually tested the feature branch with Drupal 11.2.4.
Here are the result:
The original content.
The rendered result after applying the tooltip.
The tooltip taxonomy terms:

1. CMS
2. Drupal

Comment #10
mingsongSorry, my bad. I forgot to add the '' into the allowed tag for the text format setting.
After adding it, it works as exptected.
Comment #11
mingsongThanks @Sviatoslav.
It is a brilliant ideal to introduce the excluded tags, which make it more flexible.
Thanks @Christopher for the suggestion on Comment #4. In a situation where a bold tag for a taxonomy term still need, we can use the CSS to prevent unwanted style inherited from the parent element.
So I take those two solutions together.
I think we can confidently release this change.
Appreciate all your works on this module.
Comment #13
mingsongIt will be patched with the new release.