<!-- collection.xml in profile/default/types-->
<!--
Name of add_view_expression must be match with the Name of the Adapter
-->
<!-- View information -->
<property name="add_view_expr">string:${folder_url}/++add++Collection</property>
<!-- configure.zcml -->
<!-- Register custom AddForm for Collection Type -->
<adapter
for="Products.CMFCore.interfaces.IFolderish
zope.publisher.interfaces.browser.IDefaultBrowserLayer
plone.dexterity.interfaces.IDexterityFTI"
name="Collection"
provides="zope.publisher.interfaces.browser.IBrowserPage"
factory=".views.CollectionAddFormView" />
# yourformviews.py
from plone.dexterity.browser.add import DefaultAddView
from plone.dexterity.browser.add import DefaultAddForm
class CollectionAddFormView(DefaultAddView):
form = CollectionAddForm
index = ViewPageTemplateFile("templates/collection_add_edit_form.pt")
class CollectionAddForm(DefaultAddForm):
portal_type = "Collection"
def updateFields(self):
super(CollectionAddForm, self).updateFields()
def update(self):
super(CollectionAddForm, self).update()