[Zope3-Users] Calling PageTemplate in Content object
dev at projekt01.ch
dev at projekt01.ch
Wed May 24 17:44:16 EDT 2006
Hi Tom
[...]
> > ...
> > orderform.pt
> > ...
> > <html>
> > <body>
> > My City Is:
> > <div tal:replace="order/city"/>
> > </body>
> > </html>
> >
> > ...
> >>>> step.message(request)
> >>>>
> > *** Note how nothing is returned - no exceptions and no output.
>
>
> Have a look at zope/pagetemplate/readme.txt - it shows (one
> way) how to inject 'order' into the tal 'namespace'., e.g.
>
> >>> class MyPageTemplateFile(PageTemplateFile):
> ... def pt_getContext(self, args=(), options={}, **kw):
> ... rval = PageTemplateFile.pt_getContext(self, args=args)
> ... options.update(rval)
> ... return options
>
> >>> orderform=MyPageTemplateFile('orderform.pt')
> >>> orderform(order=OrderView())
That's correct but perhaps a little to much.
Probably you are looking for something like this:
<div tal:replace="options/order/city"/>
The default namespace for *custom* keyword agruments is
called *options* in a page templates.
Regards
Roger Ineichen
_____________________________
END OF MESSAGE
More information about the Zope3-users
mailing list