Initialization Option Author API

tags

Configuration options for Tag filters which are applied by default to the search criteria for the Item list results.

Values

Request object key config.item_list.filter.restricted.tags

Type object

This object has the following properties which can be configured.

  • 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 or tags.either to also be set. The tags.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" }
                            ]
                        }
                    }
                }
            }
        }
    };

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.

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.

Was this article helpful?