[Zope] using variables in dtml

Chris Withers chrisw@nipltd.com
Fri, 09 Nov 2001 08:26:40 +0000


Steven Turoff wrote:
> 
> <dtml-let myUser="_.SecurityGetUser().getUserName()">
> <dtml-in expr="members.myUser.objectValues('Folder')">
> <li><dtml-var title_or_id></li><br>
> </dtml-in>
> 
> But this results in an error because of the reference to 'myUser'. How do I
> user this variable?

Hmm... doesn't quite work like that. Think about it; members doesn't have an
attribute 'myUser', which is what you have asked it. It has attributed like
'fred', 'harry', etc.

What you're looking for is:
<dtml-in expr="members[myUser].objectValues('Folder')">

cheers,

Chris

PS: Look into PageTemplates and PythonScripts, DTMl isn't the nicest language
you'll bump into ;-)