How to create, manage and call document tags in AnQiCMS
As an experienced website operator for AnQi CMS, I am well aware of the importance of tags in content management and user experience.Tags can not only help us better organize content, improve the SEO performance of the website, but also guide users to discover more interesting information.Next, I will introduce how to create, manage, and call document tags in AnQiCMS to help you operate your website.
The role and value of tags in AnQiCMS
In the AnQiCMS content management system, tags are a core feature that provides a flexible supplement for content classification.Different from traditional hierarchical classification, tags can cross different categories and content models, associating content with similar themes or attributes.For example, an article about "SEO optimization techniques" can be tagged with "SEO", "website optimization", "content marketing", and many other tags. These tags can effectively improve the discoverability of the content, help users quickly locate related topics, and also provide more rich semantic information for search engines, thus optimizing the SEO effect of the website.Since version v2.1.0, AnQiCMS has added the Tag label feature for articles and products, greatly enriching the possibilities of content management and display.
Create and edit document tags
AnQiCMS provides two main ways to create tags: in real-time during the document publishing process, or through the tag management feature in the background for centralized creation and editing.
When you create or edit articles, products, and other documents, you will find the "Tag label" field.You can add one or more tags to the current document here.AnQiCMS allows you to select existing tags in the system, or you can directly enter new tag text, then press the Enter key to quickly create a new tag and associate it with the current document.This convenient operation method allows content creators to set tags immediately based on the document content.
In addition to adding at the time of document publication, AnQiCMS also provides a dedicated "document tag" management interface for you to centrally manage all tags.In this interface, you can perform operations such as adding, editing, and deleting tags.Each label includes multiple configurable fields to meet the fine-grained operation requirements.This includes the 'label name', which is the display name of the label; 'index letter', used to organize labels in alphabetical order, limited to A-Z.“Custom URL”, the system will automatically generate a pinyin URL based on the tag name, and you can also manually modify it, but make sure it is unique throughout the site, and it can only contain letters, numbers, and underscores;SEO titles
Tag management and features
The AnQiCMS tag management system has high flexibility and independence.One of its most important features is that This cross-model, cross-category association ability makes the tag a powerful content aggregation tool, able to break through the boundaries of traditional classification and build a more diversified content network.
In the label management background, you can view all the created label lists at any time and edit their various properties.For example, you can change the display name of the label, update SEO information, or adjust the custom URL.When the label is no longer needed, it can also be deleted.The design of AnQiCMS aims to provide a simple and efficient tag management experience, ensuring that website operators can easily maintain and optimize the tag system.
Call document tags in the template
In AnQiCMS template design, calling label data mainly relies on a series of dedicated template tags, which are based on Django template engine syntax, allowing you to flexibly display tags and their associated content.
Invoke the tags associated with the document
On the document details page or in the document list, if you want to display the tags associated with the current document, you can usetagListTag. It allows you to get the tag list of a specific document and display it in a loop. For example:
{# 在文档详情页或其他需要展示文档标签的地方 #}
<div>
<strong>文档标签:</strong>
{% tagList tags with itemId=archive.Id limit="10" %} {# archive.Id 代表当前文档的ID #}
{% for item in tags %}
<a href="{{item.Link}}">{{item.Title}}</a>
{% endfor %}
{% endtagList %}
</div>
Get all tag lists
If you want to display a list of popular tags or an index of all tags in a certain area of the website (such as the sidebar, footer), you can usetagListlabel and specifyitemId="0"To obtain the label set of non-specific documents, or throughletterFilter specific initial letter labels through parameterslimitParameter control the number of displayed items.
{# 展示所有标签或热门标签(假设后台有排序逻辑或手动选择) #}
<h3>热门标签</h3>
<ul>
{% tagList tags with limit="20" %} {# 获取前20个标签 #}
{% for item in tags %}
<li><a href="{{item.Link}}">{{item.Title}}</a></li>
{% endfor %}
{% endtagList %}
</ul>
Display detailed information of specific tags
When a user visits a tab (such as/tag/SEO.html), you may need to display the detailed information of the tab, including its name, description, SEO title, etc.tagDetailThe tag can help you get the detailed data of the current tab:
{# 在标签详情页 (tag/detail.html 或 tag/index.html) #}
<h1>{{% tagDetail with name="Title" %}}</h1>
<meta name="description" content="{{% tagDetail with name="Description" %}}">
<p>标签描述:{{% tagDetail with name="Content" %}|safe}}</p>
List all documents under a certain tag
The core function of the tab page is to display all related documents under the tag.tagDataListTags are specifically used for this purpose, it will automatically retrieve and paginate the list of all associated documents based on the ID of the current tab:
{# 在标签详情页,列出该标签下的文档 #}
<h2>“{{% tagDetail with name="Title" %}}” 相关文档</h2>
{% tagDataList archives with type="page" limit="10" %}
{% for item in archives %}
<div>
<a href="{{item.Link}}">
<h3>{{item.Title}}</h3>
<p>{{item.Description}}</p>
</a>
</div>
{% endfor %}
{% endtagDataList %}
{# 分页导航 #}
<div>
{% pagination pages with show="5" %}
{# 包含首页、上一页、页码、下一页、尾页等分页链接 #}
{% if pages.FirstPage %}<a href="{{pages.FirstPage.Link}}">首页</a>{% endif %}
{# ... 其他分页逻辑 ... #}
{% endpagination %}
</div>
By way of the above creation, management, and invocation methods, the tag feature of AnQiCMS can help website operators build an efficient, flexible, and SEO-friendly content system, thereby better attracting and retaining users.
Frequently Asked Questions (FAQ)
How does AnQiCMS tag improve the website's SEO performance?
The tag feature of AnQiCMS supports website SEO optimization in many aspects.Firstly, each tag can be set independently in the background with its own "SEO title", "tag keywords", and "tag description", which will be crawled by search engines to enhance the relevance of the tag page.Secondly, tags support custom URLs, which can create semantic clear, SEO-friendly URL structures.In addition, tags can aggregate scattered content to form an internal link network, enhancing the overall authority and depth of the website, and helping search engines better understand the structure of the website content.
What is the difference between tags and categories, and how should they be used?
Labels and categories are both ways to organize content, but they have different focuses.Categories are typically hierarchical, with clear boundaries, used to classify content into major categories, such as 'News and Information', 'Product Introduction', etc.And the tags are flattened, more focused on describing the specific topic or attribute of the content, which can cross categories and be more flexible in association.For example, an article belongs to the 'News Information' category, but can also be tagged with 'Artificial Intelligence', 'Technology Frontier', 'Industry Analysis', and so on.When in use, core and stable content structures should be placed in categories, while refined, cross-domain topics or keywords should be set as tags to provide richer user navigation and SEO dimensions.
Can AnQiCMS tags be associated with all types of content models?
Yes, the tag design of AnQiCMS has high versatility.“Document tags are not classified and modeled”, which means that any tag you create can theoretically be associated with all content models that support tag functions such as articles, products, and pages.