[Zope] JavaScript Menu & Zope - set dynamic paths

Simon Forster simon-lists@ldml.com
Wed, 25 Jun 2003 15:42:06 +0100


Some advice please.

I have a dynamic menu written in JavaScript which is called from a 
number of different sub-folders. Seeing as Zope gives me the option of 
re-writing paths, I thought I'd use this to make life easier. So 
question:

Given a code fragment such as:

<a href="../Welcome/index.html" onmouseover="changeImages('Welcome', 
'../images/Welcome-over.png'); return true;" 
onmouseout="changeImages('Welcome', '../images/Welcome.png'); return 
true;">
<img name="Welcome" src="../images/Welcome.png" width="170" height="42" 
border="0">
</a>

what's the best way to create the paths dynamically? At the moment I'm 
using:

<a href="../Welcome/index.html" onmouseover="changeImages('Welcome', 
'../images/Welcome-over.png'); return true;" 
onmouseout="changeImages('Welcome', '../images/Welcome.png'); return 
true;" tal:attributes="href here/Welcome/index.html/absolute_url">
<img name="Welcome" src="../images/Welcome.png" width="170" height="42" 
border="0" alt="" tal:attributes="src 
here/images/Welcome.png/absolute_url">
</a>

but of course this isn't changing the path references in the JavaScript 
function - that's my next task.

This has to be a regularly performed routine and I'm interested in 
knowing what the preferred method(s) is as I want to get into good 
habits.

TIA

Simon Forster
___________________________________________________
   LDML Ltd, Office One, 16 Canham Road, London, W3 7SR, UK
         Tel: +44 (0)20 8749 7766     Fax: +44 (0)70 9230 5247
___________________________________________________