[Zope] "dynamic" dtml-with from string content
Jaroslav Lukesh
lukesh at seznam.cz
Fri Feb 17 14:15:23 UTC 2012
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 at syndicat.com>
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...
More information about the Zope
mailing list