How to add a Collection Search Widget to a custom search?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2014 02:54 AM
Since FastTrack version 5.9.3, Collections are available, documents can be added to 1-n collections and the default searches (in DM and DAM views) allow to query on collections thanks to a widget which displays a list of available collections for the user.
So. How can I add this widget to a search content-view using Studio?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2014 03:06 AM
When a document is added to a collection, a new schema is added to this document (collectionMember
), with a field storing the ids of the related collections. So, to query on collections, we need to add this schema to the Studio registry, then use a Multiple Documents Suggestion widget and format it correctly.
In the Schemas registry, add the
collectionMember
schema (warning if you already had shema(s) defined: Format the JSON accordingly):{ schemas: { collectionMember: { "@prefix" : "collectionMember", "collectionIds" : "string[]" } } }
IMPORTANT: This step will not be necessary shortly, as this schema will already be made available in Studio directly.
- In the Content-View used for DAM search, drag-Drop a Multiple Documents Suggestion widget and set the following properties:
- Field:
collectionMember:collectionIds
- (Operator
IN
: No choices) - Document page provider name:
default_collection
- This page provider makes sure only documents of type
Collection
can be chosen by the user
- This page provider makes sure only documents of type
- Hide Help Label:
Yes
(not required, but better look & feel) - Suggestion Formatter:
docSelectionDefaultFormatter
- This formater displays the list of collections without their paths (the default Multiple Documents Suggestion widget also displays the path in the list of documents)
- Field:
Reminder
This works only with Nuxeo >= version 5.9.3
