AnQiCMS in content management not only provides powerful classification functions to organize the website structure, but also opens up new ways for deep association and multi-dimensional display of content through flexible Tag tag mechanism.Imagine your website as a library, with different bookshelves categorized by different books. Tag tags are like different thematic keywords on the books, allowing readers to discover books with similar themes scattered across different bookshelves according to their interests.

Next, let's delve into how AnQiCMS uses Tag tags to make your website content more intelligent and frontend display richer.

Tag label: the 'Golden Key' associated with content

In AnQiCMS, Tag is a powerful and flexible content organization method.It is different from the traditional classification: classification is usually hierarchical and structured, used to define the 'major category' of content; while Tag tags are more like keywords or themes, which can link content with common characteristics across categories and models.A document can belong to only one category, but can have multiple Tag tags, thus achieving content aggregation and display from multiple perspectives.

This flexible association method brings many benefits:

  • Enhance user experience:Visitors can quickly find the series of content they are interested in through Tag tags, without having to navigate through complex categorization structures.
  • Enhance content association:Link scattered content with common Tags to form an organic knowledge network, increasing users' stay time on the site.
  • Optimize Search Engine (SEO):A page with clear keywords that can provide more crawling entry points and topic clues for search engines, which is helpful to improve the overall SEO performance and keyword ranking of the website.
  • Rich content display:The website front-end can intelligently recommend related articles, products, or other content based on Tag tags, making each page vibrant.

Backend management: Easily tag content

In AnQiCMS backend, the management and application of Tag labels are designed very intuitively, allowing content operators to add this 'golden key' to content efficiently.

Create and manage Tag tags

You can manage all Tag tags of the website uniformly on the "Document Tags" page under the "Content Management" menu.Here you can add new tags, edit existing tags, or delete tags that are no longer needed.

  • Index letter:Easier to organize tags in alphabetical order.
  • Customize URL:Allow you to set a friendly, SEO-friendly URL address for the label page.AnQiCMS will automatically generate pinyin as the default value based on the tag name, and you can also modify it as needed to ensure its uniqueness and compliance across the entire site.
  • SEO title, tag keywords, and tag description:These are SEO optimization items for the tag detail page, you can configure independent TDK (Title, Description, Keywords) for each tag to enhance the visibility of the tag page in search engines.

Reasonable planning and management of Tag tags is the first step to bring them into play. It is recommended that tag names be concise and clear, accurately summarizing the theme of the related content.

Add Tag tags to the document

When you create or edit a document, you will see an input box for a "Tag label". Here, you can easily add one or more tags to the current document.

  • Select an existing tag:When you type text in the input box, AnQiCMS will intelligently prompt existing matching tags, and you can select by clicking.
  • New tag:If the tag you enter does not exist, just type the tag name and press the Enter key. The system will automatically add it as a new tag and associate it with the current document.

Through this method, you can tag each document very flexibly and categorize them under multiple related topics.

Front-end Display: The Magic Moment of Tag Labels

Tag label's true value lies in their rich display on the website front end.AnQiCMS provides dedicated template tags, allowing you to cleverly use Tags to associate and display content in various corners of the website.tagList/tagDetailandtagDataListThese powerful template tags to implement.

Display the Tag list of a single document (tagList)

When the user reads a document, we usually want to display Tag tags directly related to the document, guiding them to discover more similar content.tagListTags are born for this.

You can use it in the template of the document detail page,tagListto get the tag list associated with the current document. For example:

{# 假设这是文档详情页模板中的相关Tag区域 #}
<div>
    <p>本文标签:</p>
    {% tagList tags with itemId=archive.Id limit="10" %}
    {% for item in tags %}
        <a href="{{item.Link}}" class="tag-item">{{item.Title}}</a>
    {% endfor %}
    {% endtagList %}
</div>

PassitemId=archive.IdWe explicitly tell the system to get thearchiveTag of the (document).limitThe parameter can control the number of tags displayed. In this way, users can clearly see the topics covered by this document and can click on the Tag to enter the detail page of the tag.

Display Tag detail page content (tagDetail)

Each Tag label can have its own detail page, just like a mini special topic page.When the user clicks the Tag link, the page will jump to this.tag/detail.htmlusing this template file to render Tag detail.

In this template, you can usetagDetailLabel to get the detailed information of the current Tag, such as its title, description, etc:

{# 假设这是Tag详情页模板(tag/detail.html)的头部 #}
<div class="tag-header">
    <h1>{% tagDetail with name="Title" %}</h1>
    <p>{% tagDetail with name="Description" %}</p>
</div>

So, each Tag label can have a dedicated page with rich content, providing users with more comprehensive information.

Display the document list under a specific Tag (}]tagDataList)

Tag details page core, of course, is to display all documents associated with this Tag. At this time,tagDataListLabels come into play. It allows you to get the document list under the specified TagID and supports pagination.

Intag/list.html(or}tag/detail.htmlThe Tag document list template, based on your template design, allows you to use it in this waytagDataList:

{# 假设这是Tag文档列表页模板中的文档列表区域 #}
<div class="tag-document-list">
    <h2>关于“{% tagDetail with name="Title" %}”的最新文档</h2>
    {% tagDataList archives with type="page" limit="10" %}
        {% for item in archives %}
        <div class="document-item">
            <h3><a href="{{item.Link}}">{{item.Title}}</a></h3>
            <p>{{item.Description}}</p>
            <span>发布时间:{{stampToDate(item.CreatedTime, "2006-01-02")}}</span>
            <span>浏览量:{{item.Views}}</span>
        </div>
        {% empty %}
        <p>该标签下暂无相关文档。</p>
        {% endfor %}
    {% endtagDataList %}

    {# 配合分页标签实现分页导航 #}
    {% pagination pages with show="5" %}
        {# 分页导航代码... #}
    {% endpagination %}
</div>

Here,tagDataListIt will automatically read the current Tag page ID and list all associated documents.type="page"andlimit="10"We have set up pagination display, with 10 articles per page. CombinedpaginationWith tags, you can easily build a complete Tag document list page.

It is worth mentioning that AnQiCMS's pseudo-static rules also provide friendly URL support for Tag tags, for exampletag/index.htmlUsed for Tag list pages,tag/list.htmlUsed for the document list page under a certain Tag, which lays a solid foundation for your website SEO.

Concluding remarks

The Tag feature of AnQiCMS is an important manifestation of its content management system's flexibility