Show document tags Last updated: 19. Mar 2024

Example on how to show tags for a document in display template.

Example

Code Template.hash

#if(Tags.length) {# <!-- Check if any tags are present -->
    <ul>
    <!-- Loop the tags -->        
    #for(let tag of Tags) {# 
        <li>#tag#</li> <!-- Output the tag -->
    #}#
    </ul>
#}#

Output

 <!-- Check if any tags are present -->
    <ul>
    <!-- Loop the tags -->        
     
        <li>test</li> <!-- Output the tag -->
     
        <li>tag1</li> <!-- Output the tag -->
     
        <li>tag2</li> <!-- Output the tag -->
    
    </ul>