List Tags

Simple script to list all tags using the umbraco Tag Data Type

Posted on Tuesday, January 28, 2014


I used the following namespace in a partial view:

umbraco.cms.businesslogic.Tags

If you wish to have different tags for different reasons - for example for a news type or blog type then in the Developer section of umbraco you can create different Data Types of type Tags and in the Settings section of that datatype, set a Tag Group. 
In my example i just left the group as 'default'

Adding the tags to the document is easy - using the Tag datatype in a document give something like this:

 Tags

A partial view is created with the following code:

in the example above I have added a bit of code in the anchor tag to link to a page on the website that allows pages to be viewed with a specific tag...

In the Template view  include the following:

@Html.Partial("ListTags")

 This will output a list of tags.


Ref: Source code (6.1.6) for cms.umbraco.bussinesslogic.Tags is available to view here:

https://github.com/umbraco/Umbraco-CMS/blob/6.1.6/src/umbraco.cms/businesslogic/Tags/Tag.cs