Posted by Frank Ralf on March 6, 2009 at 9:22pm
4 followers
| Project: | Tagadelic |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Frank Ralf |
| Status: | closed (fixed) |
Issue Summary
This patch adds a title attribute to each term which will show the description of the term as a tool tip when hovering with the mouse over the term. (This is the default behavior with taxonomy terms when shown in nodes.)
The feature was requested in http://drupal.org/node/390870 and the solution described in http://www.drupalcenter.de/node/16915 (including screenshots).
Frank
Comments
#1
#2
Slightly improved patch as recommend in http://www.drupalcenter.de/node/16915#comment-59445
Frank
#3
#4
Thanks for checking the code and improving it!
I had another look at the context of that title attribute code in taxonomy.module and tagadelic.module and found that neither strip_tags() nor check_plain() is actually needed in tagadelic.module because here the whole is wrapped in the link function l() which cares itself for removing all HTML and PHP tags from a tooltip:
<?php// Remove all HTML and PHP tags from a tooltip. For best performance, we act only
// if a quick strpos() pre-check gave a suspicion (because strip_tags() is expensive).
if (isset($options['attributes']['title']) && strpos($options['attributes']['title'], '<') !== FALSE) {
$options['attributes']['title'] = strip_tags($options['attributes']['title']);
}
?>
So the change in tagadelic.module can be simplified to
'title' => $term->description,.Frank
#5
#6
Thanks!
#7
I like it.
Can someone please give it a quick test on a site with real information?
After one or more positive tests, I will commit it to HEAD and Drupal 6.x.
#8
Looks ok. see screenshot.
#9
Does work as promised (see screenshot). I really would like to see it committed to HEAD.
tia
Frank
#10
changed status
#11
changed status
#12
Committed to 6 dev.
#13
Thanks!
#14
Automatically closed -- issue fixed for 2 weeks with no activity.