Hello!As an experienced website operation expert, I am well aware of the importance of a flexible content management system for efficient operation.English CMS (EnglishCMS) stands out among many CMSs due to its excellent customizability, especially in terms of content model and category management, providing great convenience.categoryListWhen labeling, you may 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 in depth and hope to provide you with a clear answer and practical operation guidance.
Anqi CMS:categoryListThe in-depth practice of label and category custom fields——detailed explanation of filtering and display strategies
In the AnQi CMS, the flexibility of content is one of its core advantages.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 FeaturesThey are carefully designed to adapt to various complex business scenarios, helping us integrate business logic into the content structure.
categoryListCore functions and common usage of labels
categoryListIt is a very practical tag in the AnQi CMS template, mainly used for traversing and displaying the category list of our website. Whether you want to list categories in the navigation bar, sidebar, or footer of the page, categoryListCan easily handle it. Its basic usage is very intuitive, usually we would usemoduleIdto specify which content model category to obtain, or useparentIdto get the child categories 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,item.Id(Category ID),item.Title(category title),item.Link(Category link)et al., these are all fields preset and directly provided by the system.
Custom field filtering:categoryListlimitations
Then, let's return to the focus of our discussion today:categoryListDoes it support filtering by custom fields according to categories? Frankly,categoryListthe tag itself does not directly support filtering through custom fields in design.This means, you cannot directly addcategoryListTagswithto the parameterscustomField="value"such conditions to filter the category list.
categoryListThe filtering parameters are mainly focused onmoduleId/parentId/limit/allandsiteIdThese parameters are designed to efficiently organize classification data by model, hierarchy, and quantity, rather than for infinite expansion of customization.