In website operation, Tag tag (also known as keyword tag) is a very practical content organization method, which can help users quickly find related content and also improve the SEO effect of website content.The AnQiCMS provides comprehensive Tag tag configuration and display features, making it easy and efficient to manage and display these tags.Now, let's get a detailed understanding of how to set up and utilize these tags in AnQiCMS.


1. Backend configuration and management of article Tag

In AnQiCMS, the configuration of Tag tags is mainly divided into two parts: adding tags when editing articles, and maintaining them through an independent tag management interface.

1. Add Tag label on the article editing page

When you publish or edit articles in the background, you will see an input box named "Tag Tag". This is the main entry for tagging your articles.

You can directly type the tag name in the input box, for example, "website operationEnter a label and press the Enter key, it will automatically convert to a manageable label item.You can add multiple tags to the same article, linking it to multiple related topics.When the label you enter already exists in the system, AnQiCMS usually provides an auto-completion feature to help you select existing labels conveniently, maintaining consistency of the labels.

2. English independent Tag label management

In addition to adding tags during article editing, AnQiCMS also provides an independent "document tag" management feature.You can find it under the content management menu in the background.This interface allows you to manage all tags on the website more comprehensively.

Here, you can perform the operations of adding, editing, and deleting tags. Each tag has multiple configurable properties, which are crucial for enhancing the SEO performance of the tag page:

  • Tag name:This is the display name of the label.
  • Index letter:Used for classification labels, usually the first letter of the label name.
  • Customize URL:You can set a friendly, personalized URL address for each tag.This is very important for search engine optimization, allowing the tag page to have a clearer link structure.It should be noted that the custom URL should ensure the uniqueness across the entire site and only supports letters, numbers, and underscores.
  • SEO title, label keywords, label description:These fields allow you to set TDK (Title, Description, Keywords) separately for each tag page.Carefully crafting unique TDK for each tag can help search engines better understand the theme of the tag page, thereby achieving better rankings.The label introduction is usually used to display descriptive content on the front-end label page.

Through these detailed configurations, you can ensure that each tag can not only effectively organize content but also become an independent page with good SEO performance.


English, In the front-end template, display the article Tag tag list

Configure the background tags, and the next step is to display them on the front page of the website.AnQiCMS through a powerful template tag system, allows you to flexibly display various forms of Tag tag list on different pages.tagList/tagDetailandtagDataList.

English, 1. Display related Tag tags on the article detail page

On the article detail page, it is usually necessary to display the Tag tags associated with the current article. This helps readers quickly understand the themes covered by the article and click to jump to other related content.

You can usetagListLabel this to achieve this. WhentagListIt is called on the document detail page, it will default read the current article's ID to get related tags.

{# 示例:在文章详情页显示当前文章的Tag标签 #}
<div>
    <strong>文章标签:</strong>
    {% tagList tags with limit="10" %} {# limit参数控制显示数量 #}
    {% for item in tags %}
        <a href="{{item.Link}}">{{item.Title}}</a>
    {% endfor %}
    {% endtagList %}
</div>

2. Display the entire site Tag tag cloud or popular tag list

If your website needs a dedicated "tag cloud" area, or wants to display the most popular or latest tag list across the entire site,tagListtags also apply.

In this case, you do not need to specifyitemId(Document ID),tagListwill be used to retrieve items that meet other conditions such aslimitlimit the number of,lettersorted by the first letter orcategoryIdTags filtered by category. Such lists are usually placed on the homepage, sidebar, or dedicatedtag/index.htmltag homepage template.

{# 示例:显示全站热门Tag标签,限制10个 #}
<div>
    <h3>热门标签</h3>
    {% tagList tags with limit="10" order="views desc" %} {# 假设存在views字段可按浏览量排序 #}
    {% for item in tags %}
        <a href="{{item.Link}}">{{item.Title}}</a>
    {% endfor %}
    {% endtagList %}
</div>

3. Display the article list under a specific Tag

When the user clicks on a Tag label, it usually jumps to a page that displays a list of all articles associated with that tag. This feature is usually implemented intag/list.htmltemplates with similar names.

You can usetagDataListTag to retrieve article data under a specific tag. This tag is particularly powerful, supporting pagination, filtering by model, and displaying by sorting method.

{# 示例:在Tag列表页显示当前Tag下的文章列表,并支持分页 #}
{# tagId通常会从URL参数或当前页面上下文自动获取 #}
<div>
    <h1>标签: {% tagDetail with name="Title" %}</h1> {# 获取当前标签的标题 #}
    <p>{% tagDetail with name="Description" %}</p> {# 获取当前标签的描述 #}

    {% tagDataList archives with type="page" limit="10" %} {# type="page"启用分页功能 #}
    {% for item in archives %}
        <article>
            <h2><a href="{{item.Link}}">{{item.Title}}</a></h2>
            <p>{{item.Description}}</p>
            <small>发布时间: {{stampToDate(item.CreatedTime, "2006-01-02")}}</small>
        </article>
    {% empty %}
        <p>该标签下目前没有文章。</p>
    {% endfor %}
    {% endtagDataList %}

    {# 分页导航 #}
    <div class="pagination">
        {% pagination pages with show="5" %}
            <a href="{{pages.FirstPage.Link}}">首页</a>
            {% if pages.PrevPage %}<a href="{{pages.PrevPage.Link}}">上一页</a>{% endif %}
            {% for item in pages.Pages %}
                <a class="{% if item.IsCurrent %}active{% endif %}" href="{{item.Link}}">{{item.Name}}</a>
            {% endfor %}
            {% if pages.NextPage %}<a href="{{pages.NextPage.Link}}">下一页</a>{% endif %}
            <a href="{{pages.LastPage.Link}}">尾页</a>
        {% endpagination %}
    </div>
</div>

In this example,tagDetailUsed to obtain detailed information about the current label.tagDataListIt is responsible for loading the list of articles associated with the label.type="page"The parameter ensures the enablement of pagination functionality and combinespaginationThe label generated a complete pagination navigation.

4. Custom URL structure of Tag page

To better support SEO and user experience, AnQiCMS allows you to customize the URL structure of Tag list pages and Tag detail pages through pseudo-static rules. In the "Pseudo-static Rule" settings in the background, you can set up thetagIndex(Tag Home Page) andtag(Tag Details) Set personalized URL patterns, for example, using/tags/{filename}.htmlor/tag/{id}.htmletc., to match your website style and SEO strategy.


Summary

Through the above steps, you can flexibly configure and display the article Tag tag list in AnQiCMS.From the fine management behind the scenes to the flexible calling of front-end templates, AnQiCMS provides a comprehensive solution to help your website content be more organized, easier to find, and achieve better search engine performance.


Common Questions (FAQ)

1. What is the difference between tags and article categories? How should I choose to use them?

The article category is usually used for hierarchical division of content, with clear parent-child or peer relationships, and a more fixed and organized structure (for example: News -> Domestic