I added a new field to default dexterity content type "File".
How can I use this field in display, searching and collections? How to hide/show this field to some groups?
Does this in the same way for different field types?
Regards.
Hugo
I added a new field to default dexterity content type "File".
How can I use this field in display, searching and collections? How to hide/show this field to some groups?
Does this in the same way for different field types?
Regards.
Hugo
To display the content of the field, you need to customize the template(s) for whatever view(s) you want it to appear in. There is some information about that here:
https://training.plone.org/5/mastering-plone/zpt_2.html
To use it in searching/collections, you need to add an index for the field:
https://docs.plone.org/external/plone.app.dexterity/docs/advanced/catalog-indexing-strategies.html
(Not sure if you are working on the filesystem on through-the-web, but there are instructions for both there.)
Thanks,abosio
<element value="collective.dexteritytextindexer.behavior.IDexterityTextIndexer" />
Then which file should I add these code to? :
from collective import dexteritytextindexer
from plone.autoform.interfaces import IFormFieldProvider
from plone.supermodel.model import Schema
from zope import schema
from zope.interface import alsoProvides
class IMyBehavior(Schema):
dexteritytextindexer.searchable('specialfield')
specialfield = schema.Text(title=u'Special field')
alsoProvides(IMyBehavior, IFormFieldProvider)
Regards.
Hugo