Taxonomy Description on hover?

Events happening in the community are now at Drupal community events on www.drupal.org.
greta_drupal's picture

Greetings, y'all.

Been grappling with this issue. I want taxonomy description, which I have painstakingly added to each term, to appear on mouseover of the taxonomy term -- or alternatively, mouseover of an added post-term icon (such as "i" symbol).

I am quite surprised that this is not default behavior. It appears to be for "allowed values", but not when those values are pulled from taxonomy.

USE CASE:
Dev site (a wiki-type site) has many content types and many fields. Most of the fields are taxonomy term fields. Both the node form and the display node are inadequate, with respect to listed tags (tax terms), without taxonomy description for clarification. All are presented as radio/checkboxes.

Creating a bunch of custom template files seems kludgy, especially since that is something will like continue to increase over time. Hoping for an automated solution.

Have tried the Tipsy module, which provides the vocabulary description upon moveover of individual terms, when using the forms override option. And, have played around with that modules custom selector options. No luck.

A bit stumped at a good, efficient, scalable UI solution. I feel as though I am overlooking something obvious -- thinking too complex.

Ideas?

Comments

To clarify: "I want taxonomy

greta_drupal's picture

To clarify: "I want taxonomy term description, "

I know that with Tipsy you

Alexander N's picture

I know that with Tipsy you should be able to just add a custom selector, which will let the module's JS find the taxonomy term anchors while, say, viewing a node.

So it'd be something like ".terms a" (unless your custom theme changed the markup), and that'd be pretty much it as far as Tipsy configurations go.

Then when you view a node what should happen is that Tipsy will grab the term links, and create the tipsy thingamajig for each, using every anchor's "title" attribute's value as the content.

Since Drupal happens to put every term's description in the title attribute of a term's anchor when it renders it, then this should Just Work.

Now, AFAIK the term descriptions are not anywhere in the markup of a node form, so I guess you would have to do some customization for it to work (i.e. edit the node form's template to output the descriptions, pass Tipsy a custom function to grab the descriptions when focusing on the select lists of the taxonomy terms, etc).

Maybe there's an option for this in D7 (which I haven't yet touched)?. I also don't know what version you're on.

Yes, I tried using the custom

greta_drupal's picture

Yes, I tried using the custom selector. There is no reference to it being a term, at this point. This is example output:

{div class="form-item form-type-checkbox form-item-field-dining-type-und-616"}<br />
{input id="edit-field-dining-type-und-616" class="form-checkbox" type="checkbox" value="616" name="field_dining_type[und][616]"}<br />
{label class="option" for="edit-field-dining-type-und-616"}Concession{/label}<br />
{/div}

But, in testing, I tried:

.form-type-checkbox label

and

.form-type-checkbox .option

Now, AFAIK the term descriptions are not anywhere in the markup of a node form, so I guess you would have to do some customization for it to work (i.e. edit the node form's template to output the descriptions, pass Tipsy a custom function to grab the descriptions when focusing on the select lists of the taxonomy terms, etc).

Yes, but again, this would require a custom template for each content type. And, that means every time a new content type is added (which could be an ongoing thing), a new custom template needs to be added. Was hoping for something for flexible/scalable.

I forgot to mention that this is D7.

Since Drupal happens to put every term's description in the title attribute of a term's anchor when it renders it, then this should Just Work.

That is evident when I mouseover a term in my taxonomy menu, which in this case I don't want. But, when I had terms displaying as links in nodes, the hover did not show description. (I have that disabled now b/c of a conflict with a custom taxonomy term view.)

It seems to have to do with the taxonomy terms being a field value, at which point that are no longer "terms" to Drupal -- loses its association to that term description. This is one reason I am stumped as to where to try to apply a solution.

That being said, the Tipsy forms manipulation option comes very close -- except that upon hover of any term it shows the vocabulary description rather than the term description.

Was thinking of

greta_drupal's picture

Was thinking of hook_form_alter as a solution, but that won't help on the node display.

Suppose that I could create every node through dynamic View, but that seems a bit crazy. And, doesn't help for the form.

(BTW: I am already using Display Suite, haven't discovered a solution there. Although the custom fields feature is very sexy. Still experimenting. )

This is very interesting

shawn650's picture

This is very interesting problem. I could be wrong, but I believe a number two black magic maker and disposable wipes would do the trick.

Sounds like a functionality

alexrayu's picture

Sounds like a functionality that should be there by default. If it's not there, let's figure it and bring attention to include it in future releases.

I agree! And, I'm trying to

greta_drupal's picture

I agree! And, I'm trying to get the issue notice. Who's with me? Let's start a revolution!

But, seriously, it is an essential feature of any form, especially questionnaire. But nice to have on node display too.

There is a feature request by another Drupaler in the Better Exposed Filters issue queue. I have reached out to the Tipsy developer, and appealed to the BEF dev (who responded to one of my posts that included this issue as well as a BEF issue). Even asked in Display Suite queue, b/c DS has a custom fields feature -- which I don't quite yet get.

Any update on this?

campbdy's picture

Hi

I am looking for this feature as well. Has there been any progress with it?

I wrote a patch to provide this functionality

vegantriathlete's picture

If you look at the taxonomy formatter module issue queue (https://drupal.org/node/1628162) you will find a patch that I wrote on June 13, 2012 to add this functionality. Somebody did at least bother to reroll it against the latest release at some point. Test it out and see if you can get the issue moved to RTBC and get the maintainer to commit the patch.