documentation icon indicating copy to clipboard operation
documentation copied to clipboard

plone/content/creating.html outdated for dexterity content (folder restrictions)

Open zopyx opened this issue 9 years ago • 4 comments

https://5.docs.plone.org/develop/plone/content/creating.html#restricting-available-types-per-folder-instance

covers folder restrictions only for AT content but no support for Dexterity content.

The API for DX content is similar and available through an adapter:

        from Products.CMFPlone.interfaces import ISelectableConstrainTypes
        aspect = ISelectableConstrainTypes(self.context)
        aspect.setConstrainTypesMode(data['constrain_types_mode'])
        aspect.setLocallyAllowedTypes(allowed_types)
        aspect.setImmediatelyAddableTypes(immediately_addable)

zopyx avatar Oct 26 '16 04:10 zopyx