Author API Initialization
tags
Configuration options for Tag filters which are applied by default to the search criteria for the Item list results.
Values
Attribute path config.item_list.filter.restricted.tags
Type object
Properties
-
allow_filtered_tags_overwrite boolean
Controls whether the author can save Items which do not meet the specified
tags
filters. By default, authors cannot save Items which do not match the specified Tag filters.You would want to use this to allow authors to save any Items regardless of filtered Tags.
Default:
false
// Allow authors to save any Item var initializationOptions = { "config": { "item_list": { "filter": { "restricted": { "tags": { "allow_filtered_tags_overwrite": true } } } } } };
-
all array[TagsV2]
Show Items that contain all of the specified Tags.
You would want to use this to only show Items that include a particular combination of Tags.
See Understanding Tag Formats for Content Creation and Filtering for more information on the TagsV2 format.
var initializationOptions = { "config": { "item_list": { "filter": { "restricted": { "tags": { "all": [ { "type": "TYPE1", "name": "NAME1" }, { "type": "TYPE1", "name": "NAME2" }, { "type": "TYPE2", "name": "NAME3" }, { "type": "TYPE2", "name": "NAME4" } ] } } } } } };
-
either array[TagsV2]
Show Items that contain at least one of the specified Tags.
You would want to use this to show any Items containing a range of Tags.
See Understanding Tag Formats for Content Creation and Filtering for more information on the TagsV2 format.
var initializationOptions = { "config": { "item_list": { "filter": { "restricted": { "tags": { "either": [ { "type": "TYPE1", "name": "NAME1" }, { "type": "TYPE1", "name": "NAME2" }, { "type": "TYPE2", "name": "NAME3" } ] } } } } } };
-
none array[TagsV2]
Show Items that do not contain any of the specified Tags.
You would want to use this to exclude any Items containing one of a range of Tags.
See Understanding Tag Formats for Content Creation and Filtering for more information on the TagsV2 format.
Important This initialization option requires either
tags.all
ortags.either
to also be set. Thetags.none
initialization option cannot be set on its own.var initializationOptions = { "config": { "item_list": { "filter": { "restricted": { "tags": { "all": [ { "type": "TYPE1", "name": "NAME1" } ], "none": [ { "type": "TYPE2", "name": "NAME3" }, { "type": "TYPE2", "name": "NAME4" } ] } } } } } };
Caveats
When Tags have been filtered out, but the author should still be able to apply some excluded Tags, one of the following solutions can be used.
For example, if the content is restricted to the "math" Tag only, but a newly authored Item should also include a "physics" Tag, the "physics" Tag can be set with the setItemTags()
method.
Alternatively, you can override the default restrictions functionality by setting tags.allow_filtered_tags_overwrite
option to true
.
Type definitions
-
tagsV2 object
Tags are used to improve searching for content while authoring and for reporting and analytics purposes.
See Understanding Tag Formats for Content Creation and Filtering for more information.
-
name string
The Tag name.
Maximum length is 255 characters.
-
type string
The Tag type.
Maximum length is 255 characters.
-