Hello,
I tried the latest version of glossify, and only the Link style ok glossary terms worked :
for Hovertips, the terms are well replaced, but nothing happend at roll over. I watched the code, for example, for one of my terms i get this in the body :
<span hovertip="feugiat" class="glossify_term hovertip_target">feugiat</span>
And this at the end of the page :
<div class="hovertip_wrap0" style="display: none;">
<div class="hovertip_wrap1">
<div class="hovertip_wrap2">
<div style="display: block;" class="hovertip hovertip_wrap3" id="">
<h1></h1>
<p></p>
</div>
</div>
</div>
</div>
But you can see that the node value is empty. I don't see common reference to link the two elements, and then no javascript is launched at rollover.
The javascript problem may come from a bad configuration of the hovertip module, because I didn't found any documentation, and I don't know how to make it work ; but it can't explain the emptyness of the term definition ; in "hovertip" and "reference section under content" case.
I already use Jquery with the JqueryTools module. But it is suoposed to execute only in a specified block ; so I don't think it comes from here.
Do you see where the problem could come from ?
Thanks for your help ;)
... and sorry for my bad english ^^
Comments
Comment #1
rsvelko commentedyour english is good.
1. What above is empty?
2. These features are untested.
3. Patches for them are welcome. I myself do not have time for that.
Comment #2
Ivo.Radulovski commentedyou could try an older version (1.x) for now - hovertips should work there
Comment #3
seren10pity commentedHello,
what is empty is the hovetip div : the
and
don't have the node content inside.
I'll try to make it work, and patch if it's working ;)
thanks Segments, I'll try the 1.x version to compare.
Comment #4
zog_zog commentedHi all,
I've got the exactly same problem. After a short dive in glossify.module, here is what I found:
The theme_glossify_term function expects a term nid, but receives a "node/__nid__", as found in the the global dictionnary. I don't understand how it can work... I guess I could make it work by writing my own theme function, which would parse basck the nid from the argument passed, but I guess you would like this to work out of the box.
Any help is welcome
Comment #5
seren10pity commentedHi,
Same finding here.
To make it work, I replaced :
$term = node_load($nid);by
to load the node with the nid.
I added this after node load for the case the node body is realy long :
and then in the
switch ($glossify_style) { [...] default :, I replaced the body output by$output .= $hovertip_text;To search words with insensitive case, I added a i at the end of the regexp in function __glossify_convert_string_array_to_array_of_escaped_regexps($needles) :
The the problem was the word replacements used the glossary terms titles instead of the found terms, so all replaced words had the first letter in capital.
What I tried next is dirty, and creates other bugs, but it solved that problem. so :
In function __glossify_replace, I used preg_replace_callback instead of preg_replace to use the word found instead of the glossary term title :
So this solves the words capitals problem, but now I can't see hovertip for words that have not the same case in the body and in the glossary, maybe because the id's are not corresponding between span words and hovertip definition blocks.
So Now, I don't know how to go further without doing big dirty mess.
Could someone help me to make glossify hovertip work neatly , what means find a way to use corresponding ids in the body hovertip spans, and in the definition blocks ; and make it work for french accented caracters.
Thanks,
Seren10pity
Comment #6
seren10pity commentedTo make all the hovertip definition blocks being created, we must search terms with case insensitive pattern too.
so, in glossify_nodeapi function, in switch ($op) { [...] case 'view': , in case 'hovertip' and case 'reference' , in the preg replace, add a i after the pattern definition :
instead of
Before, all terms were found in body, but only the blocks corresponding to case sensitive matches were created. Now, they're all created.
I still have to make it work for words with accents, and it will rock ;)
Comment #7
seren10pity commentedI don't understand why :
In function __glossify_replace($needles, $replacements, $haystack) {
If I print the regexps, and the hayshack (corresponding to the node body) just before the execution of the preg_replace, both are containing the word "accentué" ; but it looks that the preg_replace doesn't detect it.
but in glossify_nodeapi function the preg match that launch the creation of the hovertips blocks detects it !
So I have a hovertipblock created at the end of my page, in display none, but I don't have the corresponding span that highlight the word in my text !
I tried to uncomment the
$haystack = html_entity_decode($haystack, ENT_COMPAT, "UTF-8");at the start of function __glossify_replace ; but it doesn't seem to change anything.I tried many other things like htmlentities, encode, decode etc. but nothing works...
So please, help ^^
Comment #8
bchoc commentedHow is it functioning for you presently? Can your changes be made into a patch?
Comment #9
Ivo.Radulovski commentedHello we have fully rewritten the Glossify module.
The 2.x version will not be supported any more
Version 3.x supports hovertips again.