How to use the new AnQiCMS v2.1.0 article and product Tag tag feature?

Hello!As an experienced AnQiCMS website operator, I am pleased to provide an in-depth interpretation of the new article and product Tag feature added in AnQiCMS v2.1.0 version.This feature plays an important role in daily content operation and SEO optimization, enabling us to organize content more flexibly and enhance user experience.


AnQiCMS v2.1.0 文章和产品Tag标签功能详解:内容关联与SEO优化新利器

AnQiCMS v2.1.0 version introduced the long-awaited article and product Tag label feature, greatly enriching the flexibility of content management and display.This new feature allows operation personnel to add multi-dimensional tags to articles and products through keywords, thereby breaking the limitations of traditional classification and achieving free association of content across different themes.For website operation, Tag tags are not only tools for content aggregation but also key elements to improve user discovery efficiency and optimize search engine performance.

What is article and product Tag tag?

In AnQiCMS, Tag is an auxiliary classification method used to describe the theme or keywords of articles or products.Tags are flattened, different from categories (Category) with fixed levels. An article or product can have multiple Tags, and the same Tag can be associated with multiple articles or products under different categories.For example, an article about "AnQiCMS Template Making Skills" can be categorized under the "Tutorial" category and can also be tagged with "AnQiCMSThus, regardless of which keyword the user searches for or which Tag they click on, they can easily find related content.

How to manage Tag label in AnQiCMS background?

The management operation of Tag label is simple and intuitive, which conforms to AnQiCMS' design philosophy of ease of use all along.

Firstly, you can navigate to the "Content ManagementClick to enter and you will see the list of all created Tag tags, and you can perform operations such as "Add

When adding or editing a Tag label, you can fill in the following key information:

  • Tag nameThis is the display name of the Tag label and will be directly presented on the website front-end.
  • Index letter:Used for quick search and sorting of Tag tags, usually the initial letter of the tag name (A-Z).
  • Custom URLEnglish: In order to optimize SEO effect, you can set a friendly pseudo-static URL for Tag tags.AnQiCMS will automatically generate pinyin aliases based on tag names, and you can also manually modify them, but make sure they are unique across the entire site.
  • SEO title, tag keywords, tag descriptionThese are fields specifically designed for SEO.Fill in this information reasonably, which will help search engines better understand the theme of the Tag page and thus improve its visibility in search results.The label introduction is generally a brief summary of the content associated with the label.

It is worth emphasizing that Tag labels are cross-category and model-based.This means that, regardless of the content type being an article model or a product model, the same set of Tag tags can be shared and used, thus establishing associations between different types of content and achieving a broader thematic aggregation.

How to add Tag tag in an article or product?

Applying Tag tag to specific articles or products is also very convenient.

When you add a document or edit a document in the "Content ManagementYou can add one or more tags to the current article or product here.

The operation method is as follows: You can directly enter the label name in the input box.If this tag already exists in the system, AnQiCMS will provide intelligent suggestions for you to choose from; if it is a new tag, you just need to enter the full name and press Enter key, and the system will automatically recognize and add it as a new tag.This flexible addition method allows you to expand your tag library at any time while creating content.By attaching highly relevant Tags to each article and product, we can build a dense internal link network, greatly enhancing the relevance and SEO-friendliness of the website content.

How to call the Tag label in the AnQiCMS front-end template?

Displaying the Tag label on the website front-end is the key to its function.AnQiCMS provides powerful template tags, allowing you to flexibly call Tag data on various pages.

1. Display the Tag labels associated with the document

In the detail page of an article or product, we often need to display Tag tags related to the current content so that users can click to view more content of the same theme. This can be achieved bytagListTags:

<div>
    文档Tag:
    {% tagList tags with limit="10" %}
    {% for item in tags %}
    <a href="{{item.Link}}">{{item.Title}}</a>
    {% endfor %}
    {% endtagList %}
</div>

In this example,tagListThe label will default to retrieving the Tag associated with the current document.limit="10"It limits the number of tags displayed. Inside the loop,item.Linkanditem.Titleit outputs the links and names of the tags separately.

2. Get the details of the Tag label

When the user clicks on a Tag label, enter the Tag detail page (for exampletag/detail.html)When, we may need to display the title, description and other detailed information of the Tag. At this time, we can usetagDetailTags:

<div>
    <h1>{% tagDetail with name="Title" %}</h1>
    <p>{% tagDetail with name="Description" %}</p>
    {% tagDetail with name="Logo" %}<img src="{% tagDetail with name="Logo" %}" alt="{% tagDetail with name="Title" %}" />
</div>

tagDetailThe Tag defaults to getting the information of the current Tag page,nameParameter specifies the fields to be retrieved.

3. Display the document list under a certain Tag

On the Tag detail page, the most core function is to display all associated articles and products under this Tag. This can be achieved bytagDataListTag combinationpaginationTagging to implement pagination.

<div>
{% tagDataList archives with type="page" limit="10" %}
    {% for item in archives %}
    <li>
        <a href="{{item.Link}}">
            <h5>{{item.Title}}</h5>
            <div>{{item.Description}}</div>
            <div>
                <span>{% categoryDetail with name="Title" id=item.CategoryId %}</span>
                <span>{{stampToDate(item.CreatedTime, "2006-01-02")}}</span>
                <span>{{item.Views}} 阅读</span>
            </div>
        </a>
        {% if item.Thumb %}
        <a href="{{item.Link}}">
            <img alt="{{item.Title}}" src="{{item.Thumb}}">
        </a>
        {% endif %}
    </li>
    {% empty %}
    <li>
        该列表没有任何内容
    </li>
    {% endfor %}
{% endtagDataList %}

    <div>
        {% pagination pages with show="5" %}
            <a class="{% if pages.FirstPage.IsCurrent %}active{% endif %}" href="{{pages.FirstPage.Link}}">{{pages.FirstPage.Name}}</a>
            {% if pages.PrevPage %}
            <a href="{{pages.PrevPage.Link}}">{{pages.PrevPage.Name}}</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}}">{{pages.NextPage.Link}}">{{pages.NextPage.Name}}</a>
            {% endif %}
            <a class="{% if pages.LastPage.IsCurrent %}active{% endif %}" href="{{pages.LastPage.Link}}">{{pages.LastPage.Name}}</a>
        {% endpagination %}
    </div>
</div>

tagDataListThe label will be based on the current Tag page.tagIdAutomatically retrieve related documents.type="page"Turn on pagination mode and combine withpaginationTag generation of complete pagination navigation.

SEO value of Tag tags

Tag label has an indispensable value in SEO optimization:

Firstly, Tag labels can effectively enhance the keyword density and relevance of the website.By accurately adding keywords Tag to each article and product, you can clearly indicate the subject of the content to search engines, helping the content to rank better in relevant searches.

Secondly, the Tag page itself is a thematic aggregation page.When a large amount of related content is associated with a certain Tag, the search engine will consider the Tag page to have a higher degree of thematic professionalism, thereby assigning it a higher weight.

Finally, Tag tags increase the opportunity for internal links on the website.Users can click on Tags while browsing articles to quickly jump to other related content, which not only enhances user experience but also constructs a rich internal link structure, helping search engine spiders to fully crawl and index the website content.

Summary

AnQiCMS v2.1.0 introduces the new article and product Tag label feature, bringing more powerful content organization and distribution capabilities for content operation personnel.Through flexible backend management and diverse frontend call methods, we can easily achieve cross-content association, creating a richer and more accessible website structure for exploration.At the same time, making reasonable use of the SEO properties of Tag tags will bring better search engine performance and user stickiness to the website.


AnQiCMS Tag label feature frequently asked questions (FAQ)

1. What is the difference between tags and categories? When should I use tags and when should I use categories?

Tag labels and categories are tools for organizing content, but their main difference lies in structure and purpose.Categories are hierarchical, usually used to define the main content structure and navigation of a website, such as "NewsWhile Tag labels are flattened, used to describe the specific theme, keywords, or细分特性 of content, a content can have multiple Tags, and Tags can cross different categories.

You should use them in the following situations:

  • Use categoriesWhen you need to establish a clear website navigation structure, organizing content by categories. Categories are usually the first level of entry for users to discover content.
  • Use Tag tagsWhen you need to add more granular descriptions to content, achieve multi-dimensional content association, or aggregate content on specific themes.Tag label helps improve the discoverability of content and provides more keyword landing pages for SEO.

2. Can I display the content of a specific model (such as only displaying articles, not products) on a Tag tag page?

Yes, you can. In the AnQiCMS front-end template, when you usetagDataListtags to get the document list under a certain Tag, you can addmoduleIdSpecify the content model to be displayed using parameters. For example, if you only want to display the article model (assuming ID is 1) on the Tag page, you can use it like this:

{% tagDataList archives with type="page" limit="10" moduleId="1" %}
    {# ... 循环显示文章内容 ... #}
{% endtagDataList %}

This is,tagDataListOnly the content associated with the Tag under the article model will be searched and displayed.

What if the name of a Tag tag is too long and it affects the layout when displayed on the front end?

In AnQiCMS templates, you can use built-in filters to process the display name of Tag tags to avoid long names affecting layout. Common filters includetruncatechars(Truncated by character) andtruncatewords(Truncated by word).

For example, if you want the Tag name to display a maximum of 10 characters, and the rest to be indicated by an ellipsis, you can use it like this:

<a href="{{item.Link}}">{{item.Title|truncatechars:10}}</a>

You can also adjust the truncation length as needed, or further optimize the layout effect by combining CSS styles.