Sorry for such a basic question, but I'm having problems accessing variables in dtml. I want to list the subfolders of a user's folder. Something like: <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? Thanks, Steve
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 ;-)
participants (2)
-
Chris Withers -
Steven Turoff