Web Studio is here! An enhanced experience to make it easier to create, preview, and collaborate on your website contentLearn More
Content Tagging is extremely useful for creating relationships between content items, or nesting lists within an item. Agility makes this process easy and seamless.
Let’s go through the steps of setting up and getting started with content tags.
The first thing we’ll need to do is create a model for Content Tagging. To do this from the Models Section in Agility
1. Click New Content Model
2. Give it a Name, we'll use Tags
3. Add a simple Text Field and give it a name, we’ll use Title
4. Click Update Field
5. Click Usage on the right-hand side and then + Add
6. Give it a name, we used Tags again and then click Create List
You can now Navigate to the Content Dashboard, click your Tags List and then click New to start adding Tag options.
Your newly created Tags Model can now be added to another Content Model as a Linked List. To do this
1. From the Content Model Dashboard, select the Content Model you’d like to add Tags to
2. From the Add Fields menu on the right-hand side, drag and drop Linked Content and add it to the Model
3. To keep it simple, we’ll name it Tags again
4. Under the Field Properties tab select the below options
You’ll now be able to go into the content you added the Tags field to and add Content Tags from the list you created earlier.
Here’s how tags might look in an API response for a Blog Post
{
"contentID": 16,
"properties": {
"state": 1,
"modified": "2022-07-08T14:18:06.507",
"versionID": 31,
"referenceName": "blogposts",
"definitionName": "BlogPost",
"itemOrder": 1
},
"fields": {
"title": "My First Post",
"date": "2022-07-08T00:00:00-04:00",
"tags": [
{
"contentID": 11,
"properties": {
"state": 1,
"modified": "2022-07-08T14:01:19.15",
"versionID": 26,
"referenceName": "tags",
"definitionName": "Tags",
"itemOrder": 2
},
"fields": {
"title": "Sports"
},
"seo": null
},
{
"contentID": 13,
"properties": {
"state": 1,
"modified": "2022-07-08T14:01:28.367",
"versionID": 28,
"referenceName": "tags",
"definitionName": "Tags",
"itemOrder": 4
},
"fields": {
"title": "Lifestyle"
},
"seo": null
}
],
"content": "<p>This is my first blog post!</p>",
"tags_TextField": "Sports,Lifestyle",
"tags_ValueField": "11,13"
}
}
Further Reading