converting to an object
Hi, I'm setting up a navigation system. My path: http:\\server\folder1\folder2\document What is want is a listing of folders and topics contained in folder1. My dtml: <dtml-let nav3="_.string.split(URL0,'/')[3]"> <dtml-with nav3 only> <dtml-in expr="objectValues(['Portal Folder', 'Portal Topic'])" skip_unauthorized> <p><dtml-var id> </dtml-in> </dtml-with> </dtml-let> However this gives me an error, 'objectValues' is not defined. in REQUEST, nav3 is 'folder1', and what I want is just folder1, no quotes. When I substitute folder1 for nav3, it works fine. Any thoughts? TIA - Scott
Scott, I think you need to acquire the folder first. Use getitem for this: <dtml-with "_.getitem(nav3)"> <dtml-in .... ... </dtml-with> That way you can assign nav3 as the string representation of the folder you want. Maybe someone can comment on if its possible to do a multiple traverse? Something like <dtml-with "folder1.getitem(variable)"> (doesn't work, but you get the point...) Cheers, Paul Zwarts -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of Meilicke, Scott Sent: Monday, October 22, 2001 10:59 PM To: 'zope@zope.org' Subject: [Zope] converting to an object Hi, I'm setting up a navigation system. My path: http:\\server\folder1\folder2\document What is want is a listing of folders and topics contained in folder1. My dtml: <dtml-let nav3="_.string.split(URL0,'/')[3]"> <dtml-with nav3 only> <dtml-in expr="objectValues(['Portal Folder', 'Portal Topic'])" skip_unauthorized> <p><dtml-var id> </dtml-in> </dtml-with> </dtml-let> However this gives me an error, 'objectValues' is not defined. in REQUEST, nav3 is 'folder1', and what I want is just folder1, no quotes. When I substitute folder1 for nav3, it works fine. Any thoughts? TIA - Scott _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Meilicke, Scott -
Paul Zwarts