As a senior CMS website operation personnel for a security company, I fully understand the core value of content tags in website content management and user navigation.High-quality tag strategies can not only help readers find the information they need quickly, but also effectively improve the organization and SEO performance of website content.Next, I will elaborate on how to flexibly use tags in the AnQiCMS template to display tag lists or document lists under specified tags.

Understanding the content tags in AnQiCMS

In AnQiCMS, content tags (Tags) are a powerful content association tool that is independent of the classification system, allowing you to aggregate documents under different models or categories through common keywords.This flexibility makes content tags a key element for enhancing website content discovery, building related content networks, and optimizing user experience.AutoCMS provides dedicated template tags, allowing you to easily display and manage these tags and the associated documents on the website front-end.

How to display the document's tag list in the template

When you want to display a tag list in a certain area of the website, such as the sidebar, footer, or document details page,tagListLabel. This label can retrieve the tags associated with the current document, or the tags under the specifieditemId="0"When parameters are specified, retrieve all tags of the entire site (or under the specified category).

If you want to display the list of tags associated with the current document on the document details page, the code will be very concise:

<div class="document-tags">
    <strong>本文标签:</strong>
    {% tagList tags %} {# 默认读取当前文档ID的标签 #}
    {% for item in tags %}
        <a href="{{item.Link}}" title="查看所有与“{{item.Title}}”相关的文档" class="tag-item">{{item.Title}}</a>
    {% endfor %}
    {% endtagList %}
</div>

This code will traverse all associated tags in the current document and generate a list containing their titles and links.<a>.

If you wish to display a global tag list on non-document detail pages of the website (such as the homepage, category list page, or sidebar), for example, 'Hot Tags' or 'Tag Cloud', you can do so byitemId="0"Parameter to specify fetching all tags. You can also control the number of tags displayed:limitParameter to control the number of tags displayed:

<div class="global-tags-cloud">
    <h3>探索热门标签</h3>
    {% tagList tags with limit="30" itemId="0" %} {# 获取全站最多30个标签 #}
    {% for item in tags %}
        <a href="{{item.Link}}" title="探索更多关于“{{item.Title}}”的内容" class="tag-cloud-item">{{item.Title}}</a>
    {% endfor %}
    {% endtagList %}
</div>

Here,limit="30"Up to 30 tags will be displayed,