Does AnQiCMS support displaying the document list under a specific Tag on the front end?

Calendar 👁️ 69

In AnQi CMS, you can of course easily display the document list under a specific Tag (label) on the front end.This is not only a basic function of a content management system, but Anqi CMS also allows you to achieve this in a very fine and friendly way through its flexible template tag system, thereby better organizing content, improving user experience, and enhancing the SEO performance of the website.

Starting from version 2.1.0 of AnQi CMS, the system has introduced a powerful article and product Tag label feature, which means you can now add one or more tags to your content (whether it's articles or products), associating documents of different categories but related themes.These tags are not just tools for backend management; they are designed to be displayed and interacted with directly on the front end, becoming an important way for users to discover content.

To implement the front-end display of document lists under a specific Tag, the built-in template tags of Anqi CMS will be mainly used:tagList/tagDetailandtagDataListThey work together, allowing you to build a fully functional tag page.

first, tagListTags are mainly used to get all the tags list on your website, or a limited number of commonly used tags.You can use it in the website sidebar, footer, or a dedicated tag cloud page to display various tags that users may be interested in.

When the user clicks on a specific tag, they want to view all the documents under that tag.tagDetailTags can be put to use. It allows you to get detailed information about the specific tag, such as the name, description, and its exclusive link.This information can be used to build the tab page title and introduction, telling visitors which topic the current page is about.

The real core function, that is, getting the document list under a specific Tag, is to betagDataListThis tag is implemented. This tag is designed to display documents associated with a tag, and its usage is very intuitive and powerful.

When you create a tag list page (usuallytag/list.htmlSuch a template)tagDataListAutomatically detects the Tag ID contained in the current page URL and uses it to retrieve the corresponding document list. Of course, you can also usetagIdThe parameter specifies which document under which Tag to retrieve.

For example, if you want to display a list of articles under a specific tag and want to display 10 articles per page:

{# 假设这是标签列表页,系统会自动获取当前Tag的ID。我们先获取Tag的详情信息 #}
{% tagDetail currentTag with name="Title" %}
<h1>标签:{{ currentTag }}</h1>

{% tagDetail tagDescription with name="Description" %}
{% if tagDescription %}
<p>{{ tagDescription }}</p>
{% endif %}

<p>此标签下的相关文档:</p>
{% tagDataList archives with type="page" limit="10" %}
    {% for item in archives %}
    <article class="document-item">
        <h2><a href="{{ item.Link }}">{{ item.Title }}</a></h2>
        <p>{{ item.Description }}</p>
        <div class="meta-info">
            <span>发布日期:{{ stampToDate(item.CreatedTime, "2006-01-02") }}</span>
            <span>阅读量:{{ item.Views }}</span>
            {# 可以在这里显示文档所属分类等信息 #}
            {% categoryDetail categoryTitle with name="Title" id=item.CategoryId %}
            <span>分类:{{ categoryTitle }}</span>
        </div>
        {% if item.Thumb %}
        <div class="document-thumb">
            <a href="{{ item.Link }}"><img src="{{ item.Thumb }}" alt="{{ item.Title }}"></a>
        </div>
        {% endif %}
    </article>
    {% empty %}
    <p>这个标签下暂时还没有文档哦!</p>
    {% endfor %}

    {# 如果需要分页,可以接着使用 pagination 标签 #}
    <div class="pagination-wrapper">
        {% pagination pages with show="5" %}
            {# 这里是分页链接的展示代码,您可以根据自己的样式需求进行调整 #}
            {% if pages.FirstPage %} <a href="{{ pages.FirstPage.Link }}">首页</a> {% endif %}
            {% if pages.PrevPage %} <a href="{{ pages.PrevPage.Link }}">上一页</a> {% endif %}
            {% for p in pages.Pages %}
                <a href="{{ p.Link }}" class="{% if p.IsCurrent %}active{% endif %}">{{ p.Name }}</a>
            {% endfor %}
            {% if pages.NextPage %} <a href="{{ pages.NextPage.Link }}">下一页</a> {% endif %}
            {% if pages.LastPage %} <a href="{{ pages.LastPage.Link }}">末页</a> {% endif %}
        {% endpagination %}
    </div>
{% endtagDataList %}

In the above code snippet,tagDataListIt will return a namedarchivesThe document array, you can useforLoop through this array, retrieve the title, link, description, publish time, reading volume of each document, and display them according to the front-end style you design. If there are no documents under the current tag,emptyThe content in the block will be displayed. At the same time,type="page"Parameter coordinationpaginationTags, can also realize the pagination function of the list, making content management more convenient, and avoid the impact of too long content on the loading speed and user experience.

Furthermore,tagDataListit also supportsmoduleIdParameters mean you can specify only to get the tag document list under a specific content model (such as the "article" model or "product" model), which provides great flexibility for websites with multiple content types.

In summary, Anqi CMS has a well-implemented and easy-to-use feature for displaying document lists under specific tags on the frontend.By flexibly using the template tags provided, you can not only efficiently manage and display content, but also greatly enhance the organization structure of website content, improve the user's experience in discovering content on your website, and help improve the search engine's crawling and understanding of website content.


Frequently Asked Questions (FAQ)

How to ensure that the URL of the Tag list page is SEO-friendly?The Anqi CMS provides pseudo-static rule management functionality, you can configure a custom URL structure for tag pages, for example/tag/标签名称.htmlor/tags/标签别名/Set it in the "Function Management" under the "URL Rewrite Rule" in the background, and make sure your template file (such astag/list.html) Match these rules to generate clear, readable, and SEO-friendly URLs.

2. Besides the document list, what information can I display on the Tag page?On the Tag page, in addition to the document list, you can also usetagDetailLabel to get more information about the current Tag, such as its SEO title, keywords, and description. This information can be used for the page's<head>Part, enhance the SEO performance of the page. In addition, you can alsotagListdisplay tags such as "Hot Tags" or "Tag Cloud" to guide users to discover more relevant content.

3. Can my website distinguish the display of Tag lists if it has multiple content models (such as articles and products)?Absolutely, you can.tagDataListTag supportmoduleIdParameters. You can set them up throughmoduleId="1"Get the documents associated with the current Tag under the article model, or setmoduleId="2"To get the document under the product model. This means you can flexibly display or merge the document list from different content models on the same Tag page.

Related articles

How to correctly display the current page path information in the breadcrumb navigation of a website?

The website is operational, a clear navigation path is crucial for user experience and search engine optimization (SEO).When a visitor enters a deep page of the website, the breadcrumb navigation (Breadcrumb Navigation) is like a trail of breadcrumbs that guides them back, helping them understand their position in the website structure and making it convenient to return to the upper-level page.In AnQiCMS (AnQiCMS), implementing an efficient and practical breadcrumb navigation to correctly display the path information of the current page is simpler than you imagine.

2025-11-09

How do related document tags intelligently display content similar to the current article topic?

How to guide visitors to more related content naturally after they finish reading an article in content operation, which can not only significantly improve user experience, but also effectively extend the visitors' stay on the website, reduce the bounce rate, and thus have a positive impact on search engine optimization (SEO).AnQi CMS is well-versed in this, providing intelligent and flexible mechanisms that allow us to easily implement this "You might also like" content recommendation.### Content Tag: The First Step of Building Associations AnQi CMS realizes smart content association through its powerful "tag" feature

2025-11-09

How to display "Previous" and "Next" articles on the article detail page to enhance user experience?

In website content operation, continuously optimizing user experience is the key to enhancing website value.How to guide users to find more related content while browsing an article on your website, to maintain their reading interest, is a problem that every operator needs to think about.Add "Previous" and "Next" article navigation at the bottom or side of the article detail page, which is a very effective and common strategy.It not only allows users to conveniently explore the website content, reduces the trouble of returning to the list page to find things, but also extends the time users stay on the website unobtrusively, and reduces the bounce rate

2025-11-09

How does the content list on the search results page dynamically display based on the user's query keywords?

In website operation, the search function is the core to enhance user experience and help users quickly find the information they need.A highly efficient and intelligent search results page can not only meet the immediate needs of users, but also effectively guide traffic and enhance the exposure of website content.AnQiCMS (AnQiCMS) provides us with powerful tools that allow the content display on the search results page to be flexibly and dynamically adjusted according to the user's query keywords, thereby achieving more accurate and personalized content presentation.### Core Mechanism: Understanding AnQiCMS

2025-11-09

How to introduce third-party JavaScript libraries (such as Markdown, mathematical formulas, flowcharts) in templates to enhance content display?

In AnQiCMS, introducing third-party JavaScript libraries is a very effective means to make your content display more expressive and professional.For example, writing clear text with Markdown, displaying complex mathematical formulas with MathJax, or using Mermaid to draw intuitive flowcharts can greatly enrich the user's reading experience.The powerful template system of AnQiCMS provides us with a flexible integration method.## AnQiCMS template system overview First

2025-11-09

How are the "recommended properties" (such as headlines, slides) used to control the special display positions on the homepage or list?

In content operation, we often need to highlight specific content on the website, such as the latest news, popular articles, or important product recommendations.AnQi CMS provides a very practical feature - "Document Recommendation Attribute", which can help us easily achieve these diverse content display needs, making the website more attractive. ### Flexible and diverse document recommendation attributes When we enter the Anqi CMS backend to edit or publish documents, we will notice an option called "recommendation attributes".This provides a variety of preset identifiers, as if tagging the content with different labels

2025-11-09

How to view the content that has been crawled and accessed in the website traffic statistics and crawler monitoring data?

Manage a website, what we care most about is whether our content is seen by users and whether it is indexed by search engines.This data is like the pulse of the website, directly reflecting the health of content operation and the activity of the website on the Internet.AnQi CMS knows these core needs and has built practical traffic statistics and spider monitoring functions, allowing us to easily master the key performance indicators of the website.Why are we so concerned about traffic and crawler data?In short, paying attention to these data is to better understand and optimize our website. First

2025-11-09

How to optimize the display format of text and numbers using AnQiCMS filters (such as truncatechars, floatformat)?

How to make information concise, clear, and professional in website content operation?This is often a challenge faced by many operators. Whether it is a news summary, product description, or price data, statistics, if displayed in a disorganized manner, it not only affects user experience but may also lead to deviations in information transmission.AnQiCMS (AnQiCMS) fully understands this pain point, its powerful template engine built-in a series of practical filters, which can help us easily optimize the display format of text and numbers, making your website content look brand new.Refined text

2025-11-09