Re: [Zope] referencing title value as a var name
14 Aug
2001
14 Aug
'01
2:51 p.m.
Kerekes Lajos wrote:
Very special thaks. It is work. The last question. I want to put the "state sring" files under a folder named state. How can I reach the files in this case. I tried <dtml-with state> but still give NameError, it doesnt find the file named 0, 1, 2.
Thanks:
Lajos
No problem, just use this instead: <dtml-var expr="state[_.str(STATE)]"> I would recommend wrapping this in a try statement so that it doesn't blow up if the value returned is invalid, something like: <dtml-try> <dtml-var expr="state[_.str(STATE)]"> <dtml-except KeyError> The state value &dtml-STATE; is invalid. </dtml-try> hth, -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
9002
Age (days ago)
9002
Last active (days ago)
0 comments
1 participants
participants (1)
-
Casey Duncan