Hello all, I'm attempting to do variable file includes, where the actual file name is held in a column in a database, but I am having a few issues. I'm attempting to do: <dtml-in plugins> <dtml-if expr="userpluginposition == 3"> <dtml-var pluginfilename> </dtml-if> </dtml-in> But, with no luck. Is there another way to do? Any help or direction would be greatly appreciated. Thanks! -Jason
Jason Alexander writes:
I'm attempting to do variable file includes, where the actual file name is held in a column in a database, but I am having a few issues. Apparently, you want "Computed Variable Access", i.e. access a variable the name of which is not constant but only determined at runtime.
You do that with the expressions "_[name_expr]" or "_.getitem(name_expr)". The first form renders the object (what you will want in your case), the second one returns the object unrendered. More information URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html Dieter
participants (2)
-
Dieter Maurer -
Jason Alexander