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.
I know this issue was discussed in several posts for the D6 version of Taxonomy Menu:
#771266: Allow suppression of tooltip / popup / link title text on menus
#372324: Ability to turn off description,
but it doesn't seem to be solved in the latest version for Drupal 7?
Other than commenting out lines 567-568, is there a solution?
//'options' => array('attributes' => array('title' => trim($item['description'])
// ? $item['description'] : $item['name'])),
It appears that this issue is being discussed here as well:
#1237258: Over writing descriptions
#1268406: Please help how to get rid of "mouse-over" text echoing description of menu term.
Thanks
Comments
Comment #1
dstolI'm curious about what your use case is here. How are you using the description field?
And to answer your question, that's a good solution for the moment.
Comment #2
minneapolisdan CreditAttribution: minneapolisdan commentedThanks for the reply. I'm using the Description field in Taxonomy to hold 'category' descriptions, for an online store. So, one to two paragraphs are in each description. And by default then, 1-2 paragraphs get assigned as a Title for each of menu items.
Comment #3
dstolWould you rather have the description truncated, would you rather have the term name as the description, or do you have another suggestion?
Comment #4
minneapolisdan CreditAttribution: minneapolisdan commentedGood question. I guess it would be nice to just use the Term Name as Title. I know someone else pointed out that this solution would be redundant, having the HTML Title tag be the same as the Menu Title, but I don't think having the Description field is any better, given how I (and I'm guessing) and a number of other people are using the Description field.
That's my vote.
Comment #5
chriscalip CreditAttribution: chriscalip commentedanother vote for "dont use description" on menu title tags
Comment #6
johnvIMO 'Description in Menu Title Tags' is a nice feature. Please do not remove completely, a checkbox would be nice.
Comment #7
kruser CreditAttribution: kruser commentedThis is actually really bad if you use HTML in the tax description fields. I just troubleshot a "Fatal error: Unsupported operand types in common.inc on line 1592" in D6, which was caused by having a non breaking space ( ) in the description.
Nevermind I found the "Do not create title link attribute." checkbox on the Vocab edit page.
Comment #8
minneapolisdan CreditAttribution: minneapolisdan commentedKruser,
I gave a temporary fix at the beginning of this post, with which lines to comment out of your code. This is for Drupal 7, however, there are patches available for Drupal 6, I gave the links to those too. By the way, I had encountered that same error that you are referring to, in D6, because of a non breaking space in the description.
Comment #9
chriscalip CreditAttribution: chriscalip commentedAnyone wants a working patch of this feature modification; patch attached. Patch just removes the 2 lines -- does not provide settings as request by #6
Comment #10
dstolComment #11
grossmann CreditAttribution: grossmann commentedWith the possibility of fieldable taxonomys I would like to see a simple select box where I can define which field should go as title. This could be appear on the edit vocabulary page (With the other configuration of taxonomy menu). As choices there should be:
-none-
-description field- (could be default because every taxonomy has this one and would serve in 80% of the use cases)
-any other (text)field on the vocabulary-
So this can be configured on a per vocabulary base. If -none- is selected it also should be possible to just edit the description field of the corresponding menu item because it will not be overwritten.
An other possibility would be a programaticaly generated -title- field on all vocabularies where the user can add a title text. This is the more general way but can be a bit over the top if I only need a taxonomy menu for one vocabulary and have ten others for which no menu is needed.
grossmann-mcs
Comment #12
dstol@grossmann-mcs, I second your opinion but there is a long way to go before taxonomy_menu even supports using the field storage api. At the moment there is still a dependency on SQL backends.
Comment #13
moniuch CreditAttribution: moniuch commentedFully agreed. Having the description as title hugely depends on a particular setup. Wherever description contains long structured text, the effect is between tragic and comic. Checkbox definitely, please.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedI would also like to have title attributes from taxonomy terms as an optional feature, not a default. Or some way to turn it off in the user interface. Thank you!
Comment #15
schmook CreditAttribution: schmook commentedThank you for a time and effort!
It would be nice to have an option for the titles of the menu items. I changed lines 567-568 to include the name as the title:
Are there any problems with this solution?
Comment #16
moniuch CreditAttribution: moniuch commentedStrange, the patch from #9 works for one menu but not another...
Comment #17
anouHello,
First of all, thanks for this module.
For accessibility reasons, if we put the term name has the title attribute of the menu item, it should be customizable.
And I think also the description has nothing to do in the title attribute. It should be use only for the taxonomy term page.
I must mention that with this behaviour (setting the title attribute with the term description), it breaks my multilingual taxonomy...
Comment #18
jdanthinne CreditAttribution: jdanthinne commentedHi.
I've written a small patch.
It adds two options to add descriptions or not to vocabulary and terms items.
NB : you need to rebuild the menu after changing those options in order to see the changes.
Comment #20
jdanthinne CreditAttribution: jdanthinne commentedUpdated patch
Comment #21
BuFr CreditAttribution: BuFr commentedThanks jdanthinne, works for me.
Comment #22
greta_drupal CreditAttribution: greta_drupal commentedThank you for this! In the details, you indicate this is for branch "Taxonomy menu - 7.x-1.x".
However, the line numbers do not match up to my 7.x-1.2 module file. I could manually match this up wherever the code exists, but just want to confirm for which version the patch works. This issue is filed under -dev branch.
TY.
Comment #23
jenlamptonPatch applies to the git checkout for me, but not to the -dev release from the module page (for whatever reason).
Thanks for the fix!
Comment #24
Barrett CreditAttribution: Barrett commentedCommitted to 7.x-1.x branch.
Comment #26
maximpodorov CreditAttribution: maximpodorov commentedPlease add the option to completely drop the title attribute of menu items. Popup title repeating item name can be treated as a broad joke.
Comment #27
dstolGreat idea, can you open a new issue since it's a new feature request? Thanks!
Comment #28
carajito CreditAttribution: carajito commentedMy problem is:
I will delete the title on my menu, but when I create a new content then the menu link take the title again. Will be fine if we can edit the configuration to show or not the description taxonomy on the menu link
Comment #29
Barrett CreditAttribution: Barrett commented@carajito, The issue you're reporting is unrelated to the issue addressed here. Please open a new ticket if you need help.
Comment #30
hles CreditAttribution: hles commentedComment #31
splash112 CreditAttribution: splash112 commentedReopening, ported patch in #20 to 2.x-dev
Please test
Comment #31.0
splash112 CreditAttribution: splash112 commentedbetter links to issues.
Comment #33
dstolThe Drupal 6 version is no longer supported