`categoryList`Does it support filtering or displaying based on custom fields by category?

Calendar 👁️ 60

Hello! As an experienced website operations expert, I am well aware of the importance of a flexible content management system for efficient operations.AnQiCMS stands out among many CMSs with its excellent customizability, especially in terms of content models and category management, providing great convenience.However, many operators are usingcategoryListWhen tagging, you might be curious about a question: Does it support filtering or displaying based on custom fields according to categories?Today, let's delve into this issue and hope to provide you with clear answers and practical guidance.


Anqi CMS:categoryListThe in-depth practice of label and custom classification field - detailed explanation of filtering and display strategies

In AnQi CMS, the flexibility of content is one of its core advantages.The system allows us to customize various fields for different content models (such as articles, products) and their subcategories (Category).These custom fields, such as 'Category Features', 'Industry Attributes', 'Recommendation Index', etc., can greatly enrich our description and management dimensions of content, providing more possibilities for front-end display.They are carefully designed to adapt to various complex business scenarios, helping us integrate business logic into the content structure.

categoryListThe core functions and common usage of labels

categoryListIt is a very practical tag in the Anq CMS template, mainly used for traversing and displaying the classification list of our website. Whether you want to list categories in the navigation bar, sidebar, or footer, categoryListCan easily handle. Its basic usage is very intuitive, we usually specifymoduleIdto get the category of the content model to be retrieved, or throughparentIdto get the subcategories under a parent category.

For example, if you want to get the article model (assumedmoduleId="1") under all top-level categories, your template code may look like this:

{% categoryList categories with moduleId="1" parentId="0" %}
    {% for item in categories %}
        <div>
            <h3><a href="{{ item.Link }}">{{ item.Title }}</a></h3>
            <p>{{ item.Description }}</p>
        </div>
    {% endfor %}
{% endcategoryList %}

In this loop,itemThe variable will contain basic information about each category, such asitem.Id(Category ID),item.TitleCategory Title,item.LinkCategory Links, etc., these are all fields preset and provided directly by the system.

Custom field filtering:categoryListLimitations

Then, let's go back to the main point we are discussing today:categoryListDoes it support filtering based on custom fields by category? Frankly,categoryListThe tag itself does not directly support filtering through custom fields.This means you cannot directly addcategoryListlabel'swithto the parameterscustomField="value"to filter the category list with such conditions.

categoryListThe filtering parameters are mainly focused onmoduleId/parentId/limit/allandsiteIdOn system built-in properties. The design intention of these parameters is to efficiently organize classification data according to model, level, and quantity, rather than for infinite expansion customization

Related articles

How to display different content in the `categoryList` loop based on the different `moduleId`?

As a senior website operations expert, I fully understand that the flexibility of content presentation is crucial for user experience and operational efficiency.AnQiCMS (AnQiCMS) relies on its powerful template engine and content model mechanism to provide us with a powerful tool for achieving this flexibility.Today, let's delve into a very practical scenario: how to intelligently display distinctive content according to different `moduleId` in the `categoryList` loop.

2025-11-06

Does the `categoryList` return category link automatically adapt to the pseudo-static rule set in the background?

As an experienced website operations expert, I know the importance of URL structure for website SEO and user experience.AnQiCMS (AnQiCMS) fully considered this from the beginning, its static and SEO optimization features are one of its core highlights.Today, let's delve into a common concern of operators: When using the AnQiCMS `categoryList` tag to call category links, will these links automatically adapt to the pseudo-static rules set in the background?

2025-11-06

When should the `categoryList` tag be used instead of the `navList` tag to build website navigation?

In the flexible and powerful template system of AnQiCMS, building website navigation is one of the basic tasks of content operation.We often encounter two seemingly similar but distinct tags: `categoryList` and `navList`.As an experienced website operations expert, I am well aware of how to cleverly use these tools according to the specific needs of the website to achieve **user experience and content management efficiency.Today, let's delve deeper into when we should prioritize `categoryList` over

2025-11-06

What is the corresponding relationship between the `categoryList` tag in template development and the background "document classification" function settings?

As an experienced website operation expert, I deeply understand that the core value of a Content Management System (CMS) lies in the seamless connection between the backend configuration and the frontend display.AnQiCMS (AnQiCMS) excels in this aspect with its efficient architecture based on the Go language and flexible design.Today, let's delve deeply into the development of the Anqi CMS template and the `categoryList` tag, how it closely corresponds to the background "Document Category" function, and how we巧妙运用 this correlation to build powerful website functions.##

2025-11-06

How to implement the display of the 'sibling categories' of the current category in `categoryList`, instead of the subcategories?

AnQi CMS is an efficient and customizable content management system, playing an important role in website operations.Its template system is powerful and flexible, allowing operators to finely control the display of content according to actual needs.Today, let's delve into a common issue in actual operation that beginners may find confusing: how to cleverly display 'sibling categories of the current category' in the `categoryList` tag, rather than its subcategories.It is of great significance to display the brother category list in terms of content organization and user experience.

2025-11-06

Can the `moduleId` parameter of the `categoryList` tag specify multiple model IDs for a union query?

As an experienced website operations expert, I have a deep understanding of the powerful functions and flexible template system of AnQiCMS (AnQiCMS).In daily content operations, we often encounter the need to aggregate and display different types of content.Today, let's delve into the usage of the `categoryList` tag's `moduleId` parameter, especially the issue of whether it can specify multiple model IDs for a joint query.

2025-11-06

How to quickly view all available fields and values of the `categoryList` returned item object during template debugging?

During the development and debugging of Anqi CMS templates, we often need to gain a deep understanding of the data structure returned by template tags in order to control the display of page content more accurately.Especially like the `categoryList` such list tags, it will loop to output multiple `item` objects, each carrying rich data.How can we quickly and comprehensively view the available fields and their corresponding values in the `item` object returned by `categoryList` when debugging?

2025-11-06

`categoryList`How to use the `empty` tag block when no categories are found, and how to customize prompt information?

As an experienced website operations expert, I know that every detail in the presentation of website content may affect the user experience and the professional image of the website.Especially in the scenario where data is "missing", how to avoid making the page look stiff, blank, or even confusing to users is a task that requires careful design.Today, let's delve into how to skillfully use the `empty` tag block to customize friendly prompt information when the `categoryList` tag in AnQi CMS does not find any category data.

2025-11-06