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