The edit form was easy - the trick is to set the browser view
for to the behavior instead of the type:
The add form, however, I can't seem to make work with ONLY THE BEHAVIOR - I have to set it for all add forms (for the 'story' portal type). It registers to the FTI - but how to I isolate it to a behavior?
Python is simple enough:
But the ZCML is quite different:
<adapter for="Products.CMFCore.interfaces.IFolderish zope.publisher.interfaces.browser.IDefaultBrowserLayer plone.dexterity.interfaces.IDexterityFTI" provides="zope.publisher.interfaces.browser.IBrowserPage" factory=".browser.AddView" name="story" /> <class class=".browser.AddView"> <require permission="cmf.AddPortalContent" interface="zope.publisher.interfaces.browser.IBrowserPage" /> </class>
I thought replacing 'IFolderish' with my behavior would work, but even the docs say 'you must not do this' and it doesn't work.
Maybe a layer? But I don't want to get into the whole 'most specific layer' problem even if it does work.
Any thoughts or experience you can share?