Hello again,

On Fri, 2009-02-13 at 02:20 +0100, Carsten Senger wrote:
> Hi Tim,
> 
> Tim Knapp schrieb:
> > Hi,
> > 
> > I would like to use plone.z3cform in a viewlet but I'd also like to add
> > some descriptive text beside the widget as well as some other
> > miscellaneous TAL/HTML. In order to render the widgets in the
> > plone.z3cform how do I get access to them, are they available from the
> > 'view' object somehow or by some other means? I'm also assuming to
> > render the widget (once I've got it), I just call the widget.render()
> > method?
> 
> <tal:r replace="structure python:view.widgets['message'].render()" />
> 
> You need to use your own layout cause the standard form wrapper wraps 
> the form into the main_template.
> This should work (untested):
> 
> from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
> 
> layout = ViewPageTemplateFile('mylayout.pt')
> 
> wrap_form(my_unwrapped_form, index=layout)

This works great thanks. Only problem is when I do the view.widgets call
in the template I get an AttributeError as per this traceback[1]. Why
isn't view.widgets available? It renders fine without the 'layout'.

Thanks,
Tim

[1] http://paste.plone.org/26350

> 
> ..Carsten


_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to