[Zope] How to do this trick..
J Cameron Cooper
zope-l at jcameroncooper.com
Mon Mar 27 17:36:38 EST 2006
Jason C. Leach wrote:
> I'm wondering how I can do this little trick (sp_info is a globaly
> devide var, it's a dictionary obj):
>
> <option tal:repeat="group groups/existing/high"
> tal:content="group"
> tal:attributes="onmouseover string:doTooltip(event,
> '${sp_info/${group}/common_name}')"
> onmouseout="hideTip()">
> </option>
>
> So based on my the value of 'group' from my repeat, I want to use the
> value to look up another value in a different dictionary. It works if
> I do this: (event, '${sp_info/whatever/common_name}') but does not
> like me using the embedded ${group}.
The ${var} syntax is only for inserting a value in a string expression.
Path expressions only take known names. If you want to look up a value
based on a variable, you must use Python. Look at the first half of this:
http://plone.org/documentation/how-to/addContentProgrammatically
--jcc
--
"Building Websites with Plone"
http://plonebook.packtpub.com
More information about the Zope
mailing list