By marcel tuchek on
dear forum,
is there any possibility to add "alt attributes" or tooltips to terms? so that these also would be shown on "mouse over" in a tagadelic tag cloud?
greets
dear forum,
is there any possibility to add "alt attributes" or tooltips to terms? so that these also would be shown on "mouse over" in a tagadelic tag cloud?
greets
Comments
You are looking for title attribute
You are not looking for alt, but for title attribute... you can add it easily to any html tag, just like alt. Alt tags are for image descriptions, not tooltips. In most browser (except IE) alt text won't be showed in a form of a tooltip - you need to use title attribute for that. Alts are displayed only, when image is not loaded. Hope that helps.
sorry ..
.. ok, "title attributes" then .. but: how can i app these to terms? the problem is, that you can't get into the html of the taxonomy terms .... can you?
_
Sure you can! There's almost nothing in drupal that can't be overridden. If you're a code jockey, you can do it with a preprocess_node function in the template.php file-- for an example of how this is done checkout the acquia_marina theme. Alternatively, you could checkout the http://drupal.org/project/term_display module-- i haven't tried it, but it looks like it could do the job.
no code jockey
no i'm not a "code jockey" at all. what i need is the "title attribute" within the tags of a tagadelic wordcloud. but i don't understand that much php to get this working in the "tagadelic.module".
can anyone help me there?
_
meh-- by bad. I didn't catch the 'tagadelic' part of your op. it's even easier then-- tagadelic includes a theme_tagadelic_terms function (or something like that) you can easily use to theme the links. Just copy the function from tagadelic.module to the template.php file of your theme (just create one if the theme doesn't already have one), change the name to phptemplate_tagadelic_terms and add the 'title' attribute right to the link.
Patch: title attributes for tagadelic
It's a bit more difficult because tagadelic doesn't fetch the description (for the content of the title attribute) from the database in the first place. So in addition to changing the function you have to add that to the SQL.
There's a patch for adding those title attributes to tagadelic terms in the issue queue under http://drupal.org/node/393494
Frank