Hey there,
We made some significant modifications to the Tooltips module and would like to contribute them back for review to be committed or just in case anyone is interested in a couple extra features. We've added support for HTML, URL specification, a settings page, cck specification which is used for node ID specification.
Basically, you can opt to only specify [nid:3] in a body and tooltips will automatically turn that into a tooltip with the nodes title as the tooltip title, node teaser as the tooltip message, and the tooltip's title becomes a link to the node. The nid: specification is optional, but when it is used, there is another aspect available related to CCK's. You can add 2 basic text-field CCK's to a content-type, one for tooltip title, one for tooltip message: when these are specified on a node that is being referenced via tooltips by [nid:3], it is automatically replaced as the title or message specified in the node. On the settings page is where you can specify the machine readable version of the CCK for each, such as field_tooltip_title and field_tooltip
Example specifications:
[nid:3]
[nid:3 tip:Link Text override]
[nid:3 tip:Link Text override = Tooltip content override]
[nid:3 tip:Link Text override = <img src="/someimage.gif" style="float:left;"> Tooltip content override with html image]
[nid:3 url:http://www.google.com]
Example of the settings page:
http://img.vishun.com/7b48aa12f9e75051f3f16672dc9c733f.png
If you have any comments or suggestions, feel free to let us know.
Thanks,
VISHUN Studios
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | Cut off Tooltips.png | 276.69 KB | bisonbleu |
| #11 | tooltips-6.x-1.1.rev_.tar_.gz | 8.13 KB | vishun |
| tooltips-6.x-1.1.rev_.tar_.gz | 8.08 KB | vishun |
Comments
Comment #1
vishun commentedForgot to mention regarding the CCK aspect that you can do the same as title and message as you can for url (per node specify a would be referenced URL). Another overall concept you can do with all this is have a content-type just as a source for tooltips, where you would create new tooltips to be referenced that would hold a specified and reusable title, message, and url.
Comment #2
jajathejazzcat commentedVery nice addition! But when using the tooltips without the nid option (e.g. [tip: text=tooltip]), the javascript doesn't stop you from clicking the link like the original version does. The code in line 208 uses l() function and that's probably why the javascript gets filtered and altered.
Using normal html tags solves the problem.
So instead of
use the following code.
Comment #3
Ela commentedTested with the suggestion above. Works great! :)
Comment #4
Ela commentedumm.. however I keep running into this error on reports page:
in_array() [function.in-array]: Wrong datatype for second argument in /home/.../public_html/sites/all/modules/tooltips/tooltips.module on line 206.
Comment #5
Anonymous (not verified) commentedBrilliant - was just wishing for this, and here it is!
Small downer - I'm getting the same error as Ela, but on lines 160 & 186 also.
Comment #6
Ela commentedHi Andrew.. I am not 100% sure, but I think I only get this error when browsing with Firefox. Can you confirm?
Comment #7
Anonymous (not verified) commentedEla - have definitely seen it in Firefox and Safari. I can't remember if I've seen it in IE.
Comment #8
Anonymous (not verified) commentedProblems seem to be with the if statements at lines 127, 145, 160, 176, 186, 197 and 205. Can't tell if it's first time through the foreach loop when $searches is not initialised, or if it's something else.
I thought I had a fix for this, but I was wrong. The behaviour is inconsistent and not fully reproducible. BTW, have definitely seen it coming up in Firefox, Chrome & Safari now.
Comment #9
Ela commentedInteresting.. I think I only see it on line 206.. and never when using IE.
Comment #10
vishun commentedHey there guys,
Both surprised and happy to see that this has been well received. Sorry for the long delay in a response, been busy busy and often forget to check the My Issues on drupal. We will definitely check out the issues described and see what we can do.
Comment #11
vishun commentedBasically the error is caused by the variables for the search and replace not being declared as an array. Which in turn led to it trying to use a bool as an array thus causing the wrong datatype errors. It appeared in different places due to different pattern matching relative to how you were using it. The variables are now set to an empty array before it's processed and should work fine now.
Comment #12
Anonymous (not verified) commentedThanks vishun
Comment #13
Ela commentedYEY! Thank you for the fix :) seems to be working :)
Comment #14
vishun commentedNo problem, our pleasure. Should we consider contacting the module maintainer to check out this thread and consider reviewing and committing this revision? Actually might need to get back ported to 5x also, or i suppose these features could be found in 6x only.
Comment #15
Ela commentedDefinitely!.. this would be a nice addition to include in official version of the module
Comment #16
wizonesolutionsI agree with this. Glad I found this issue before patching stuff myself.
Comment #17
bsenftner commentedIs this fix in the current 6.x-1.1 release?
Comment #18
vishun commentedi do not believe so. i did try to get ahold of the maintainer, tmallen, but never heard back from him. will try one more time
Comment #19
tmallen commentedI am here! I will work this into a release shortly, (or, vishun, if you get a CVS account, I'd be happy to give you access for this project).
Comment #20
vishun commentedhey! actually we dont have a CVS account yet but will likely be acquiring one soon as we have a module or two that we'd like to release. will definitely let you know when we do though, thanks for the offer.
Comment #21
tmallen commentedvishun, if you apply for an account I will leave a comment on your application (just email me the link) stating that there is need, so that you can contrib to this project. Should be approved in no time from there.
Comment #22
vishun commentedYee haw :) CVS account request has been posted, thanks again tmallen for the suggestion, we have been needing this appropriate nudge in the right direction. http://drupal.org/node/872620
Comment #23
avpadernoFYI, I granted vishun access to this project repository.
Comment #24
vishun commentedthank you kiamlaluno, much appreciated
Comment #25
daneyuleb commentedDid this ever get added to the current dev release?
Comment #26
vishun commentedI personally did not but will check it out this week to see what the scenario is.
Comment #27
zazinteractive commentedGreat additions. thanks for your work
Comment #28
wizonesolutionsDoesn't seem like this ever did get added to the -dev release. @vishun, are you interested in maintainership? The module seems abandoned. Perhaps one of us could apply to be a code maintainer and commit the changes to the codebase. I know they are useful and in many cases necessary. What do you think?
Comment #29
wizonesolutionsOh, I see that you already have access to this repository @vishun. If you want to give me sufficient access...I'd be willing to commit and push the code appropriately. I maintain other modules, so I don't need any hand-holding :)
Comment #30
vishun commentedDefinitely would love to get the changes committed. I'm not sure I already have access to this project, or at least it doesn't show up in my project dashboard.
Comment #31
wizonesolutionsOh indeed. It seems like you lost access or something? I would file an issue in the Webmasters queue and ask @kiamlaluno about it. Reference the comment where you were granted access. Also make sure you checked the box agreeing to the Git terms of use in your profile :)
Alternatively, tmallen can give you access directly just to this project if tmallen wants.
Comment #32
wizonesolutionsHmm, putting links inside the tooltip text breaks things. It seems like the regex that looks for "=" is a little too greedy. Trying to get it to work...will post a patch if the solution is presentable.
Comment #33
wizonesolutionsHrm...I see why this is such a pain to fix. Using the a block-level element bestows a lot of benefits in terms of styling and matching the site styling, although it doesn't allow links in the tool tip. Hrm. I'll just see if the client is cool with that...and if not...well, I'd like to say that I would make them themeable, but probably I'll just wind up hacking something together :/
Comment #34
bisonbleu commentedHi all,
Perhaps this is not the place to say so but, tips are beeing cut off on the right (Drupal 6.22/Acquia Prosper). See attachement. This occurs with the following versions:
- tooltips-6.x-1.1.rev_
- tooltips-6.x-1.x-dev
- tooltips-6.x-1.1
Any suggestion or fix?
Comment #35
Ela commented@bisonbleu... I also have this problem
Comment #36
vishun commentedHave you checked the CSS of the parent container? This almost seems like it might be caused by a content area with overflow: hidden; property on it. For instance, this likely only happens when the tooltip is on the far right of the content area yah? I am not sure how this might be overcame but probably via CSS.
Comment #37
djween commentedHi,
Is the HTML enabled version here: http://drupal.org/node/316112
or only found via this page:
http://drupal.org/node/679692#comment-2694134
Thanks,
Dan
Comment #38
avpadernoI am closing this issue, which is for a not supported Drupal version.