The Tag Object
An object that represents a tag in a space.
Each space can have separate tags with the same name. The Management API can retrieve all of them with the all_tags parameter. The response then includes two properties that represent different data points.
| Property | Counts |
|---|---|
taggings_count | The number of tags with this name that exist in the space, or The number of draft or published stories with this tag, or The number of deleted stories with this tag |
tag_on_stories | The number of draft or published stories with this tag |
The following scenarios illustrate possible property values, depending on the number of stories associated with each tag and the status of the stories (draft/published, deleted):
-
For tags assigned to draft or published stories,
taggings_countandtag_on_storiesreturn the same number of tagged stories. -
For tags assigned only to deleted stories,
taggings_countreturns the number of tagged stories, andtag_on_storiesreturns0. -
For unassigned tags,
taggings_countreturns1, andtag_on_storiesreturns0.
For example, when you assign a tag to five stories and then delete all five stories, taggings_count returns 5, but tag_on_stories returns 0.
If you delete only four stories, both properties return 1.
Properties
Section titled “Properties”- name string
The name of the tag.
- taggings_count number
- The number of tags with this name that exist in the space, or - The number of draft or published stories with this tag, or - The number of deleted stories
with this tag The minimum value of
taggings_countis1, not0.
- The number of tags with this name that exist in the space, or - The number of draft or published stories with this tag, or - The number of deleted stories
with this tag The minimum value of
- tag_on_stories number
Only visible when passing the
all_tagsparameter. The number of stories currently associated with the tag, corresponding to the Assigned items column in the Tags tab.
{ "name": "Editor's choice", "taggings_count": 1, "tag_on_stories": 1 }, { "name": "test-tag", "taggings_count": 1, "tag_on_stories": 0 }Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy. Terms of Service apply.
Get in touch with the Storyblok community