Hi all, After reading the DTML namespace how-tos, I have to admit that I'm still somewhat confused by it -- especially on how to call another DTML method from another DTML method and pass the namespaces from one to another. I know this is probably a question that's been asked before, but after searching through all archives and Zope documentation, I haven't found a solution :(. For example, I have this simple folder structure: /myFolder (folder) /index_html (dtml method) /render_item (dtml method) where render_item is called by index_html several times but with slightly different parameters. I've been able to make it work by doing a call to "REQUEST.set" and set my input parameters accordingly like this (index_html): ... <dtml-if "some_condition"> <dtml-call "REQUEST.set('input_var1','value1')"> <dtml-else> <dtml-call "REQUEST.set('input_var1','value2')"> </dtml-if> <dtml-var render_item> ... But what I would really like to do is this: <dtml-if "some_condition"> <dtml-var "render_item(_,_.None,REQUEST,input_var1='value1')"> <dtml-else> <dtml-var "render_item(_,_.None,REQUEST,input_var1='value2')"> </dtml-if> I've tried the code above (this is something that I've seen in the archives) but it gives me back an error about the title key error(a property in myFolder) which is the first dtml variable displayed on render_item: ....<snip> <P> <STRONG>Error Type: KeyError</STRONG><BR> <STRONG>Error Value: title</STRONG><BR> </P> ...<snip> File C:\myzope.com\lib\python\DocumentTemplate\DT_Util.py, line 321, in eval (Object: render_item(_, _.None, REQUEST, render_format='default' )) File <string>, line 0, in ? ...<snip> So my question is: What are the (????) parameters make that make an exact equivalent (namespace stack-wise) of calling this: <dtml-var render_item> in terms of this?: <dtml-var "render_item(?????)"> And can I tack on my own namespace by passing it my own variables like this?: <dtml-var "render_item(?????,input_var1='input_value1')"> Hope my question is clear enough for an answer. TIA, Abigail Montero abimontero@apexmail.com ____________________________________ Email services provided by ApexMail http://www.apexmail.com
participants (1)
-
Abigail Montero