Returning an unrendered DTML Document object to a ZPT
Hi, I am passing an unrendered DTML document object to a Zope Page Template, as the first item of the list referenced by the 'args' key of the options namespace. I subsequently want to reference the attributes of this object. I have tried: <div tal:define="python:nocall(options['args'][0])"></div> but this gives a split error, the relevant portion of the traceback being: Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__ __traceback_info__: nocall(options['args'][0]) Module Python expression "nocall(options['args'][0])", line 2, in f Module Products.PageTemplates.PythonExpr, line 81, in __call__ Module Products.PageTemplates.Expressions, line 158, in __init__ AttributeError: split Doing: <div tal:define="nocall: options/args"></div> correctly returns the 'args' list, with the object as the first item, but I can't seem to find the syntax to then reference this first item, without using a tal:repeat statement. Any help would be much appreciated. Dominic
Dominic Hiles wrote:
I have tried:
<div tal:define="python:nocall(options['args'][0])"></div>
Seeing as how 'python:' doesn't autocall unless you suppress it the way path expressions do, this should work just fine: "python:options['args'][0]" Cheers, Evan @ 4-am
participants (2)
-
Dominic Hiles -
Evan Simpson