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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tragic.rich created an issue. See original summary.

pifagor’s picture

Status: Active » Needs review
FileSize
866 bytes

Patch

Status: Needs review » Needs work

The last submitted patch, 2: taxonomy_menu-2811625-2.patch, failed testing.

Adrian83’s picture

Thanks 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.

droprocker’s picture

Subscribe!

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.

sascher’s picture

A 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.

gaurav.kapoor’s picture

Status: Needs work » Needs review
FileSize
620 bytes

Added a truncate statement which will reduce description to 50 character.

gaurav.kapoor’s picture

Forgot to import the class.Adding new patch.

dstol’s picture

Status: Needs review » Closed (duplicate)