views:

250

answers:

2

I'm working on plone 3.2.1 and I've made a formlib's form with a custom template:

from Products.Five.formlib import formbase
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
...

class MyForm(formbase.PageForm):
    ...

    template = ViewPageTemplateFile('myform.pt')

I want to make a simple change to the standard formlib template. My question is: how do I reference the parts/zope2/lib/python/zope/formlib/pageform.pt inside my template?

<!-- myform.pt -->
<metal:macro metal:use-macro="WHAT GOES HERE??">
  <div metal:fill-slot="extra-info">
    I just want to put a text before the standard formlib template
  </div>
</metal:macro>
+1  A: 

Finally, I found the answer:

<html xmlns="http://www.w3.org/1999/xhtml"                                            
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      metal:use-macro="context/main_template/macros/master">
<body>
  <div metal:fill-slot="main">
    <div metal:use-macro="context/@@base-pageform.html/macros/form">
      <metal:block fill-slot="extra_info">
        <!-- HERE we go -->
      </metal:block>
    </div>
  </div>
</body>
</html>
jdinuncio
A: 

Just watch out there (for anyone looking for this, like me): the line:

<divmetal:fill-slot="main">

needs a space in between div and metal:

<div metal:fill-slot="main">

Thanks; very helpful solution.

DJ