Re: "dynamic" dtml-with from string content
"Jaroslav Lukesh" <[email protected]>
| Newsgroups | gmane.comp.web.zope.general |
|---|---|
| Message-ID | <071301cced7e$97444e00$6164a8c0@IBMXP> |
varx = 'this is the text" <dtml-var "_['varx']"> = <dtml-var varx> = 'this is the text" varxx = 'varxy' <dtml-var "_[varxy]"> = <dtml-var varx> = 'this is the text" my_class_path is i.e. "folder1.folder_sub" so: <dtml-with "_[_.string.split(my_class_path, '.')[0]]"> <dtml-with "_[_.string.split(my_class_path, '.')[1]]"> ......your code </dtml-with> </dtml-with> Some tips: <dtml-var "restrictedTraverse(_.string.join(VirtualRootPhysicalPath,'/') + '/path/to/your/document',None).title"> google: dieter chap3 zope ----- Puvodní zpráva ----- Od: "Niels Dettenbach" <nd-ImmFMecdQhFWk0Htik3J/[email protected]> I try to define a property "my_class_path" (string) on a folder and want to use that within a dtml-with statement - i.e.: my_class_path is i.e. "folder1.folder_sub" <dtml-with "folder1.folder_sub"> seems to work, but i cant find any easy way to to use the content of the string my_class_path within the with statement. If i just have a single folder to get aquisition from, i just can use something like: <dtml-with "_[my_class_path]"> but if i have deeper pathes in my_class_path the this doesnt work. I just can do directly: <dtml-with "_['folder1']['folder_sub']"> but i can't just put "_['folder1']['folder_sub']" into my_class_path too - this didn't works too... _______________________________________________ Zope maillist - [email protected] https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )