[ZPT] variables and javascript

Mitch Pirtle mitchy at spacemonkeylabs.com
Fri Oct 10 11:42:28 EDT 2003


On Fri, 2003-10-10 at 11:34, Charlie Clark wrote:
> On 2003-10-10 at 17:23:59 [+0200], Mitch Pirtle wrote:
> > Hi list,
> > 
> > Dumb question - I've inherited a site that is using javascript-based 
> > rollovers for buttons, and have integrated everything in ZPT except for 
> > the source of the image:
> > 
> > <a onMouseOut="MM_swapImgRestore()"
> >     tal:attributes="href string:${portal_url};
> >     onClick string:MM_goToURL('parent','$portal_url');;return
> > document.MM_returnValue;
> >     onMouseOver
> > string:MM_swapImage('image_home','','http://10.0.3.120:8080/development_site/media/home_over.gif',1);"><img 
> > tal:attributes="src string:${portal_url}/media/home.gif" width="26" 
> > height="30" name="image_home" border="0" alt="Go Home"></a>
> > 
> > The trouble is that I cannot figure out how to reference $portal_url in 
> > the onMouseOver call.  Is there a better way to do this?
> 
> Isn't here/portal_url required? Otherwise ignore string and use python
> 
> <a tal:attributes="src python:'%s/media/home.gif' %here.portal_url"></a>
> Should work assuming portal_url is available.

I have figured out how to do this for the attributes, but how do you mix
TAL statements with javascript function calls?

-- mitchy




More information about the ZPT mailing list