Page 1 of 1

Tooltips

Posted: Mon 21. Jun 2004, 06:36
by kpimichael
I want to use the javascript library by Walter Zorn called TOOLTIPS
http://www.walterzorn.com/tooltip/tooltip_e.htm#docu
to create some rollover tooltips in my articles. Soooo. I created a php program to generate the <a> tags as necessary from a database. It works beautifully across browsers (standalone)...until i include the code into an article with the php tag. The data is listed...but no mouseover tooltips are showing.

I assume it has something to do with css or the way javascript must be included in phpwcms. Since i am a php programmer and no little about html :oops: I am at a loss to see where the conflict is. Have any of you included tooltips or other javascript successfully in an article?

Thanks in advance for taking the time to read my problem

Posted: Mon 21. Jun 2004, 14:52
by Jan212
plz post the rendered source/ a link to your page...

Posted: Mon 21. Jun 2004, 22:59
by kpimichael
Jan212 wrote:plz post the rendered source/ a link to your page...
Thanks for some feedback. Here is the code when run standalone outside of phpwcms. http://www.wheredotheystand.com/cms/s2/ ... 25,0,0,1,0

When i put it as an php program in an article page... this is what i get:
http://www.wheredotheystand.com/cms/ind ... 25,0,0,1,0

All the tooltips are gone. Here is what the <a> tag looks like that is being generated...by the php program

Code: Select all

<a onmouseover="this.T_SHADOWWIDTH=3;this.T_STICKY=true;this.T_OFFSETX=10;return escape('<? if ($source) echo "Source: ".$source."<br>";?><?if ($quote_date)echo "Date: ".$quote_date."<br>";?>  <?if($attributed_to) echo "Attributed To:".$attributed_to."<br>";?> <?If ($entries_key) echo "Key: ".$entries_key."<br>";?> <?if($link) echo "Link: ".$link."<br>";?>')">
<b><?echo $title;?></b> <br> <?echo $quote;?></a><br>
with some php echo's thrown in :)

I have looked at the DEFAULT.css that is used in the frontend...and dont see any conflicts...but then again I am not a css person and am not sure i know which css files are being pulled together. This is driving me crazy. Something in phpwcms is overriding or stoping my onmouseover.

Thanks for taking a look. I appreciate all i see you do on the boards... I hope to get familiar enough with PHPWCMS so that i can help others too. :) But seems the more i dig, the less i know about it :?

Posted: Mon 21. Jun 2004, 23:30
by Oliver Georgi
the tag has to be placed inside the head section of your template (I think).

Oliver

Posted: Tue 22. Jun 2004, 00:12
by DeXXus
Have you tried a "fully-qualified" path in this tag??

Code: Select all

<script language="JavaScript" type="text/javascript" src="wz_tooltip.js"></script>
like: "/path/to/cms/s2/wz_tooltip.js"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
How about as an experiment, placing a "copy" with similar phpWCMS files in "/include/inc_js/" and modifying the tag like this:

Code: Select all

<script language="JavaScript" type="text/javascript" src="/include/inc_js/wz_tooltip.js"></script>

Gonna Take me Some time i think

Posted: Tue 22. Jun 2004, 05:24
by kpimichael
I tried all your ideas....with no success. I think i am going to have to do some traces as a page is built and see what is happening. I will let you know if i figure it out. :shock: I suspect that it would be useful to someone else over time. Thanks

Posted: Tue 22. Jun 2004, 07:57
by Oliver Georgi
try to fill it into the footer section or at the end of the main block of your template like

Code: Select all

{CONTENT}
<script language="JavaScript" type="text/javascript" src="phpwcms_template/inc_js/wz_tooltip.js"></script>
Maybe the script only works if it is placed between <body></body>.

You should not try absolute path like /mypath. ;-)

Oliver

I hate my solution but it works!!!

Posted: Thu 24. Jun 2004, 22:50
by kpimichael
The javascript code was very sensitive as to where it occurs. I could not get it in a layout or template or article...right where i needed the code to be. So i changed the index.php code to put the javascript right in before the closing body tag. I don't like the solution because i will have to keep track of Olivers changes... but here is the temporary solution for those interested in trying it. This is about line 100 in current release.

Code: Select all

// MIKE Inserted the one line below to all tooltips to function
echo '<script language="JavaScript" type="text/javascript" src="phpwcms_template/inc_js/wz_tooltip.js"></script>';
echo "</body>\n</html>";

ob_end_flush();
Thanks to all for the suggestions made on the board.
GO Oliver!!!!!

Posted: Thu 24. Jun 2004, 23:54
by Oliver Georgi
No problem - index.php will not be changed very often ;-) - but you can fill it into the footer section - has the same effect (I think).

Oliver