[z3-five] Formlib custom template - AttributeError: debug.
Tim Hicks
tim at sitefusion.co.uk
Fri Feb 16 00:35:21 CET 2007
Maciej Wisniowski wrote:
> Hi
>
> I want to create custom template for Formlib based form.
> My code is at the bottom of this post. Zope 2.9.6, Five 1.4.2
> In general I tried to define template with:
>
> template = namedtemplate.NamedTemplate('mytemp')
> template = ViewPageTemplateFile('mytemp.pt')
I managed to get things working by using the following:
from Products.Five.browser import pagetemplatefile
from plone.app.form._named import named_template_adapter
_template = pagetemplatefile.ViewPageTemplateFile('pageform.pt')
default_named_template_adapter = named_template_adapter(_template)
Not sure if it's the "right" way of doing it, but it works for me.
hth,
Tim
More information about the z3-five
mailing list