Publication Data Source
9 min
overview the publication data source fetches publications from the catalog api it is used wherever a list of publications needs to be rendered — publication pickers, multi publication homepages, or dropdowns that let users switch between publications when to use this use publication when you need to display or select from a list of publications it is not for fetching content within a publication — use content for that basic example { "type" "publication", "contextkey" "publications", "batchsize" 50 } live example view /examples/datasources/publication configuration type specific properties property type default description filter object — narrows which publications are returned sort object or array — controls the ordering of results for common properties ( contextkey , limit , batchsize , etc ) see todo insert link to data sources overview link filter properties filter key type description id stringfilter fetch a specific publication by id type { value, negated? } restrict by publication type language stringfilter restrict by publication language properties mapfilter filter by custom publication properties contents contentlistfilter filter publications by their content — { negated?, content? { operation, value contentfilter }, size? intfilter } issues issuelistfilter deprecated — use contents instead supports and , or , and condition — see todo insert link to data sources overview link sort properties sort accepts a single comparator object or an array of comparators sort key type description currentcontentpublicationdate { direction } sort by the most recent content publication date index { direction } sort by index field property { key, valuetype, direction } sort by a custom property ( valuetype string or int ) direction accepts asc or desc advanced features loading a single publication into context { "type" "publication", "contextkey" "currentpublication", "limit" 1, "filter" { "id" { "value" "\ publicationid" } } } testing notes / edge cases large publication counts default batchsize is 24 if you have more publications, increase batchsize or the list will be truncated without a visible error empty filter returns all omitting filter returns every publication the api exposes ssr caching only set preventssrcache true if publication availability is user specific related topics todo insert link to data sources overview linktodo insert link to content data source link