Does AnQiCMS's Tag document list (`tagDataList`) support filtering by content model?

Calendar 👁️ 75

As an experienced website operation expert, I am more than willing to deeply analyze AnQiCMS in detailtagDataListThe function of filtering tags by content model. In today's increasingly refined content operation, being able to flexibly organize and display content is the key to improving user experience and optimizing SEO.AnQiCMS in this aspect, with its powerful content model and tag management functions, provides us with many conveniences.


In-depth analysis: AnQiCMS Tag document listtagDataListHow to implement content model filtering

In the powerful content management system of AnQiCMS, tags (Tag) and content models (Content Model) play a crucial role.The content model gives us the ability to define structures for different types of content, such as articles, products, cases, etc.And tags provide a flexible horizontal linkage mechanism, allowing content under different models to be linked together through common keywords or themes.So, when we want to accurately display a specific content model document in a tab, can AnQiCMS meet this requirement?The answer is affirmative.

AnQiCMS'tagDataListTags, as the core tool used to call the document list under a specific tag in the template system, indeed supports filtering by content model.This brings great flexibility and accuracy to content operation.

Understanding the role of content model and tags in AnQiCMS

One of AnQiCMS's core advantages lies in its flexible content model feature.It allows you to customize the structure of content according to your business needs. For example, a blog website may need an "article" model, including title, author, content, publication date, and other fields;An e-commerce website may need a "product" model, which includes product name, price, inventory, image set, etc.This custom ability allows AnQiCMS to adapt to various complex business scenarios, making your content management more organized.

And tags (Tag) are another powerful dimension for content organization and retrieval.Tags can cross the limitations of hierarchical categories and content models, aggregating content with similar themes or keywords.For example, a tag about "AI technology" can be associated with multiple articles in a technical blog, as well as the AI product introduction page in the product catalog, and even linked to company news mentioning AI dynamics.

tagDataListCore function and content model filtering

tagDataListTags are in the AnQiCMS template system, specifically used to call and display document lists associated with a specific tag. Its basic usage is based ontagIdTo get all documents under a specific tag. However, in actual operation, we often encounter such scenarios: in a tab named "AI Technology", we may want to only display the "article" model content related to the tag in one area of the page, and display the related "product" model content in another area.At this moment, only bytagIdCannot distinguish the content model to which these documents belong.

The core of realizing this refined filtering function lies intagDataListthe label provides a namedmoduleIdthe parameter.

By usingmoduleIdSpecify the corresponding content model ID, you can accurately control it.tagDataListThe document returned only belongs to the specific content model.This means, you can easily distinguish and display all contents belonging to the 'AI Technology' tag, according to their content models (such as articles, products, services, etc.)

For example, assuming your "article" model ID is1while the "product" model ID is2. If you want to list the relevant articles and products in a tab named "AI Technology", you can write the code in the template like this:

{# 假设当前页面的Tag ID已自动获取,或者您通过其他方式获取了Tag ID #}
{# 示例中,我们用“当前Tag的ID”来表示 #}

<h3>AI技术相关的文章</h3>
{# 调用当前标签下,所有“文章”模型的文档 #}
{% tagDataList articlesByTag with tagId="当前Tag的ID" moduleId="1" type="list" limit="10" %}
    {% for item in articlesByTag %}
        <div class="article-item">
            <h4><a href="{{ item.Link }}">{{ item.Title }}</a></h4>
            <p>{{ item.Description|truncatechars:100 }}</p>
            <span>发布日期:{{ stampToDate(item.CreatedTime, "2006-01-02") }}</span>
        </div>
    {% empty %}
        <p>暂无AI技术相关的文章。</p>
    {% endfor %}
{% endtagDataList %}

<hr>

<h3>AI技术相关产品</h3>
{# 调用当前标签下,所有“产品”模型的文档 #}
{% tagDataList productsByTag with tagId="当前Tag的ID" moduleId="2" type="list" limit="8" %}
    {% for item in productsByTag %}
        <div class="product-item">
            <a href="{{ item.Link }}">
                <img src="{{ item.Thumb }}" alt="{{ item.Title }}" />
                <h5>{{ item.Title }}</h5>
            </a>
            <span class="price">¥ {{ item.Price }}</span>
        </div>
    {% empty %}
        <p>暂无AI技术相关产品。</p>
    {% endfor %}
{% endtagDataList %}

In this code, we make two calls totagDataListtags to specifymoduleId="1"(article model) andmoduleId="2"(Product model), thus achieving the purpose of accurately filtering and displaying different types of documents under the same label.

exceptmoduleId,tagDataListAlso supports other useful parameters such astagId(Specify Tag ID,)limit(Limit Display Quantity,)order(Sorting Method, such as by ID, views, etc.,)type(List Type, supports pagination) as wellsiteIdSpecify site data in a multi-site environment). The combination of these parameters can help you build highly customized, feature-rich label content pages.

practical application and operation value

This feature has a significant value in practical content operation:

  • Accurate content display:Can only display the content type that best meets the user's current needs in a specific page area, improving the accuracy of information matching.
  • Optimizing user experience: Users can clearly see the distinction between different content models while browsing tabs, quickly locate the required information, and reduce search costs.
  • Enhance SEO structure:By filtering the model, you can create more targeted tag aggregation pages for different content models, which helps search engines better understand the content of the page and optimize keyword rankings.
  • Flexible operational strategy:Allow operation personnel to flexibly adjust the display weight and layout of various contents on the tab page according to market feedback or business focus, without changing the underlying content data.

Summary

In summary, AnQiCMS'stagDataListTag through introductionmoduleIdParameters provide strong capabilities for content operators to filter label documents according to the content model.This not only reflects the advantages of AnQiCMS in content management flexibility, but also lays a solid foundation for building a more intelligent, personalized, and efficient website content structure.Flexibly utilizing this feature will greatly enhance your website content management efficiency and user interaction experience.


Frequently Asked Questions (FAQ)

  1. How can I know the specific ID of my content model?You can go to the AnQiCMS backend management interface, enter the "Content Management" module under "Content Model".Here, you can view the list of all content models created, each model will have a unique ID identifier.As a rule, both the 'Article Model' and the 'Product Model' have a default ID, and the custom model you define will also have the corresponding ID.

  2. tagDataListCan I press multiple keys at the same timemoduleIdto filter?According to the current AnQiCMS documentation,moduleIdThe parameter is designed to accept a single content model ID. If you need to display tag documents under multiple content models at the same time but also want to distinguish them, it is recommended that you do so like in the article example, divide

Related articles

How to accurately retrieve related documents based on `tagId` for the `tagDataList` tag?

As a senior website operations expert, I have a deep understanding of AnQiCMS's powerful content management capabilities.In daily operations, the refined organization and efficient distribution of content are crucial for improving user experience and SEO performance.Today, we will delve into a very practical template tag in AnQiCMS, `tagDataList`, and see how it helps us accurately retrieve related documents based on `tagId`, thus better constructing the content ecosystem.

2025-11-07

How to display the list of all documents associated with the Tag on the Tag detail page?

In content operation, tags (Tag) are the key tools for connecting content, enhancing user experience, and optimizing search engine optimization (SEO).A well-designed Tag detail page that not only allows users to quickly find related content of interest, but also clearly communicates the organization structure and thematic relevance of the website's content to search engines.AnQi CMS as an efficient and flexible content management system provides strong and intuitive support in this aspect, allowing content operators to easily achieve fine-grained content operation.

2025-11-07

How to get the SEO title and description information of a specified Tag using the `tagDetail` tag?

As an experienced website operations expert, I know that in today's highly competitive digital environment, every detail can affect the visibility and user experience of a website.AnQiCMS (AnQiCMS) provides powerful tools for our refined operation with its high efficiency, flexibility, and SEO-friendly features.Today, let's delve deeply into a very practical template tag in AnQi CMS, `tagDetail`, and see how it helps us accurately obtain and optimize the SEO title and description information of the specified Tag (label) page.

2025-11-07

How to create an independent Tag detail page in AnQiCMS ( `tag/index.html` )?

## Create an independent Tag detail page in AnQiCMS (`tag/index.html`) As an experienced website operations expert, I fully understand the great potential of tags (Tag) in content organization and Search Engine Optimization (SEO).A well-designed tag page that not only helps users find relevant content quickly but also brings valuable long-tail traffic to the website.AnQiCMS as an enterprise-level content management system based on the Go language excels in providing efficient and customizable content management solutions

2025-11-07

How to implement document sorting and pagination display on the Tag document list page?

AnQi CMS is an efficient and flexible content management system, and its Tag feature is an important way to organize and discover content.When a user visits a specific Tag page, they often expect to see all documents related to that Tag, and these documents should be presented in an orderly and easy-to-browse manner.This involves how to implement document sorting and pagination display on the Tag document list page.

2025-11-07

How to apply the `tagDetail` tag's 'Logo' field on the Tag detail page?

As an experienced website operations expert, I am well aware of how to fully utilize each field in a content management system to transform it into an effective tool that attracts users and enhances the value of the website.AnQiCMS (AnQiCMS) with its flexible and versatile characteristics, provides us with a lot of room to maneuver.Today, let's talk about the `tagDetail` tag, which has a seemingly ordinary but limitless potential field - 'Logo', and see how it shines on the Tag detail page.

2025-11-07

How to customize AnQiCMS's Tag detail page template (`tag/list.html`)?

As an old veteran in website operation for many years, I know that every detail of a page may affect the overall performance of the website, especially in SEO and user experience.AnQiCMS is an efficient and flexible content management system that provides us with powerful customization capabilities, allowing us to make each page unique.

2025-11-07

How to configure the custom URL of the Tag to take effect in the pseudo-static rules?

AnQi CMS as an experienced website operation expert, I know that the structure of URL in a content management system is crucial for the SEO and UX of a website.A clear and meaningful URL can not only help search engines better understand the content of the page, but also make it easy for visitors to understand at a glance.Today, let's delve into how to configure the "Custom URL for Tag" in Anqi CMS in the pseudo-static rules to make it truly effective, making your website's Tag page more competitive.### AnQi CMS and URL Optimization

2025-11-07