Taxonomy Data Source
8 min
overview the taxonomy data source fetches taxonomy nodes from the catalog api it is used to build tag clouds, filter dropdowns, and any component that needs to display or select from the available taxonomy of a publication when to use this use taxonomy when you need to list or navigate taxonomy nodes it replaces the deprecated category type and should be used for all new taxonomy driven components basic example { "type" "taxonomy", "contextkey" "topics", "filter" { "type" { "value" "topic" } } } configuration type specific properties property type default description filter object — narrows which taxonomy nodes are returned sort object or array — controls the ordering of results includecontents number | getcontentsparams 0 include content items for each taxonomy node pass a number to set how many contents to fetch per node, or a full getcontentsparams object for more control hideempty boolean — exclude taxonomy nodes that have no contents only effective when includecontents is set fetchoptions object — optional fetch request options (e g totalcount false for faster requests) 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 taxonomy node by id name stringfilter filter by taxonomy node name type stringfilter taxonomy type slug (e g tag , topic , section ) parentid stringfilter fetch child nodes of a specific parent node properties mapfilter filter by custom taxonomy properties contents contentlistfilter filter nodes by whether they contain specific content — { negated?, content? { operation, value contentfilter }, size? intfilter } supports and , or , and condition — see todo insert link to data sources overview link sort properties sort key type description id { direction } sort by taxonomy node id name { direction } sort by taxonomy node name property { key, valuetype, direction } sort by a custom property ( valuetype string or int ) direction accepts asc or desc advanced features hierarchical taxonomy { "type" "taxonomy", "contextkey" "subtopics", "filter" { "parentid" { "value" "$context taxonomy id" } } } testing notes / edge cases type is required in most cases omitting type returns all taxonomy node types mixed always specify it unless mixing is intentional no publication field taxonomyfilter has no direct publication field use properties or other means to scope if needed large taxonomies publications with hundreds of tags can exceed the default batchsize of 24 hideempty requires includecontents setting hideempty true without includecontents has no effect — contents must be fetched for the empty check to work a value of 1 for includecontents is sufficient deprecated category type replace with taxonomy and add a type filter matching the equivalent taxonomy type related topics todo insert link to data sources overview linktodo insert link to content data source link