Collection-Content Data Source
7 min
overview the collection content data source fetches the contents of a specific curator collection from the catalog api it gives editorial teams direct control over what appears in a list — the items and their order are managed through the curator tool, not by api filters this is the correct replacement for the deprecated collection type basic example { "type" "collection content", "contextkey" "featured", "collectionid" "home featured", "batchsize" 10 } this loads the contents of the home featured collection and exposes them as $context featured configuration type specific properties property type default description filter object — required identifies which collection to load fetchoptions object — optional fetch request options (e g totalcount false skips the count query for faster requests) filter properties filter key type description id stringfilter match collections by id name stringfilter match collections by name properties mapfilter match collections by custom property key/value common configuration (inherited) all common data source properties apply — limit , offset , batchsize , contextkey , maxcacheage , etc for more details, see data sources overview docid\ fumbuabweon oto5wfevf advanced features dynamic collection id from context the collectionid can be resolved from context to make a single view definition serve different collections { "type" "collection content", "contextkey" "items", "collectionid" "$context collection id" } for more details on value interpolation, see todo insert link to value interpolation testing notes / edge cases collection must exist if the collectionid does not match a published collection in the catalog api, the data source returns an empty list with no error always verify the collection id matches exactly (case sensitive) editor controlled order unlike content , results are returned in the order editors placed them in curator sort overrides are not applicable if ordering seems wrong, check the curator configuration empty collection an empty collection returns zero items the ui should have an appropriate empty state limit vs collection size if limit is smaller than the number of items in the collection, only the first n items (in curator order) are shown this is intentional for "top n featured" patterns caching collection contents are cached after an editor updates a collection in curator, changes may not appear immediately depending on the maxcacheage setting do not use randomize with curated collections — it defeats the editorial ordering related topics todo insert link to data sources overview todo insert link to content data source todo insert link to value interpolation todo insert link to curator documentation