2009-05-28 28 views
0

Je travaille sur plone 3.2.1 et je l'ai fait la forme d'un formlib avec un modèle personnalisé:+ plone formlib: comment référencer form.pt

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

class MyForm(formbase.PageForm): 
    ... 

    template = ViewPageTemplateFile('myform.pt') 

Je veux faire un simple changement le modèle formlib standard. Ma question est: comment puis-je référencer les parties/zope2/lib/python/zope/formlib/pageform.pt dans mon modèle?

<!-- 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> 

Répondre

1

Enfin, j'ai trouvé la réponse:

<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> 
0

montre juste là (pour tous ceux qui cherchent pour cela, comme moi): la ligne:

<divmetal:fill-slot="main"> 

a besoin d'un espace entre div et métal:

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

Merci; solution très utile.