How to efficiently organize and present website content in today's increasingly complex content management, allowing users to easily find the information they are interested in, while also improving the website's search engine performance, is a problem that every website operator is thinking about.AnQiCMS provides a series of powerful features to meet these challenges, among which the Tag feature is undoubtedly a powerful tool to connect and enrich the relationship between content.

Tag label, as the name implies, is like various small labels attached to articles or products. They can cross traditional classification boundaries and cleverly associate content with the same theme, keywords, or attributes.Tags are more flexible and inclusive than categories in terms of hierarchy and exclusivity, a document can belong to a single category but can have multiple tags, thus being discovered from different dimensions by users and search engines.

Back-end settings and management: Tag content

In AnQiCMS backend, adding Tag labels to documents is an intuitive and simple process.When you enter the "Content Management" module, whether it is for "Publishing Documents" or editing existing documents, you will find a section named "Tag Tag" on the editing interface.

Here, you can freely input keywords or topics related to the document content as tags.For example, an article about "AnQiCMS Deployment Tutorial", you can add tags such as "AnQiCMS", "Deployment", "Tutorial", "GoLang", "CMS".Each time a label is entered, press the Enter key, and it will automatically be converted into an independent label.It is more convenient that the system will intelligently prompt you with existing tags that you can directly select to avoid creating duplicates.

The value of these tags lies in the fact that they are not confined to any specific category or content model.That is to say, an article about 'AnQiCMS Deployment', and a product introducing 'AnQiCMS Theme Template', if both are tagged with 'AnQiCMS', then they are associated through this tag, even though they belong to different content models and categories.

In addition, AnQiCMS also provides an independent "Document Tag Management" page, allowing you to centrally manage all tags on the website.Here, you can edit the tag name, set a custom URL (crucial for SEO optimization), fill in the SEO title and description for the tag, and even add index letters and an introduction for the tag.These detailed settings make each tag itself become an independent 'content theme page' with good SEO-friendliness.

Front-end display and content correlation: Make the tags come alive

On the frontend page, AnQiCMS presents these carefully set Tag tags vividly to the user through flexible template tags, and establishes a deep connection between contents in this way.

1. In the document detail page, display related tags

When a user reads a document, they often hope to find more similar themed content. In AnQiCMS, you can find the template (usually) on article or product detail pages.{模型table}/detail.htmlIn the English translation, you can easily call all tags associated with the current document.

UsetagListTags, you can list all tags of the current document and generate clickable links for each tag. For example:

{# 在文档详情页,显示当前文档的所有标签 #}
<div>
    相关标签:
    {% tagList tags with limit="10" %}
    {% for item in tags %}
    <a href="{{item.Link}}">{{item.Title}}</a>
    {% endfor %}
    {% endtagList %}
</div>

Thus, after reading a document, users can directly jump to more content with the same theme by clicking on these tags, greatly improving the efficiency and user experience of content discovery.

2. Build website tag cloud or popular tag list

To enable users to better understand the popular topics covered by the website, you can display a tag cloud or a list of popular tags in the website's sidebar, footer, or a dedicated tab page. This can be achieved bytagListTag, and specifyitemId="0"English for all tagslimitTo implement:

{# 在网站首页或侧边栏,显示全站热门标签 #}
<div>
    热门标签:
    {% tagList tags with itemId="0" limit="20" %} {# itemId="0"表示获取所有标签,limit限制数量 #}
    {% for item in tags %}
    <a href="{{item.Link}}">{{item.Title}}</a>
    {% endfor %}
    {% endtagList %}
</div>

You can even combinecategoryIdparameters to achieve 'Show the popular tags used in the relevant documents under a certain category', further refining the range of tag display.

3. Create an independent tag aggregation page

When a user clicks on a tag, they expect to see a dedicated page that aggregates all documents with that tag. AnQiCMS provides dedicated template files (usuallytag/list.htmlortag/index.html)to host these pages, and make use oftagDataListtags to implement this core function.

on these tag aggregation pages,tagDataListThe label will automatically identify the current page's label ID and retrieve all associated document lists. It also supports pagination to ensure that even if the content under the label is large, it can be displayed smoothly:

English

<h1>标签:{% tagDetail with name="Title" %}</h1> {# 显示当前标签的标题 #}
<p>{% tagDetail with name="Description" %}</p> {# 显示当前标签的描述 #}

{% tagDataList archives with type="page" limit="10" %}
{% for item in archives %}
<li>
    <a href="{{item