Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently the Taxonomy Menu seems to fill the 'title' field on the taxonomy menu link with the taxonomy description field. However the Description field can be lengthy and this leads to a rather lengthy title attribute. I think ideally the title attribute would be filled with the taxonomy term title. But at a minimum it requires some truncation.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2811625-8.patch | 885 bytes | gaurav.kapoor |
| |||
#7 | 2811625-7.patch | 620 bytes | gaurav.kapoor |
#2 | taxonomy_menu-2811625-2.patch | 866 bytes | pifagor |
term description.PNG | 87.26 KB | tragic.rich |
Comments
Comment #2
pifagorPatch
Comment #4
Adrian83 CreditAttribution: Adrian83 commentedThanks for reporting this. I could not figure out what was triggering those huge title tooltips when hovering over these menu items. It seems like a nice solution would be to allow the site builder to use tokens to configure which field to pull the title field value from when configuring the taxonomy menu at /admin/structure/taxonomy_menu/my_menu. The default could be the taxonomy name or a trimmed description.
Comment #5
droprocker CreditAttribution: droprocker commentedSubscribe!
I found a temporary solution. I've applied the patch from this thread: https://www.drupal.org/node/2853074
In /src/Entity/TaxonomyMenu.php in Line 244 I changed
'description' => $term->getDescription(),
to'description' => '',
You can fill in whatever you need. In my case I just needed an empty title-attribute in my link.
Comment #6
sascher CreditAttribution: sascher as a volunteer commentedA patch from this issue - https://www.drupal.org/node/2831437 seems to solve the issue by creating a UI enhancement of letting users pick the field they want to use.
Comment #7
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedAdded a truncate statement which will reduce description to 50 character.
Comment #8
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedForgot to import the class.Adding new patch.
Comment #9
dstolFixed in #2831437: Make the description field customizable