What is the corresponding relationship between the `categoryList` tag and the classification related fields in the background `content model` settings?

Calendar 👁️ 57

As an experienced website operations expert, through my practice with AnQiCMS, I deeply understand that its flexible and powerful content management capabilities are the cornerstone of website success. Today, let's delve into a seemingly simple but highly flexible core mechanism:categoryListThe label corresponds to the classification field in the background "content model" settings.Understanding this can help you better control the presentation of website content, achieving truly customized operation strategies.


The blueprint role of content models

To understandcategoryListLabel, we first need to talk about the core concept of AnQiCMS - the 'Content Model'.In AnQiCMS, the content model is like the 'blueprint' or 'template' for different types of content on your website.It defines which fields and properties a certain type of content should include.For example, an "article model" may include fields such as "article title", "publish date", "author", and "content", while a "product model" may include fields such as "product name", "price", "inventory", and "product image set".

The strength of AnQiCMS lies in the fact that these models not only have built-in common fields but also allow you to highly customize according to actual business needs, adding unique fields such as 'article source', 'product color', 'house type', etc.These custom fields will become additional information that can be filled in when you publish specific content (documents).

Classification: the 'location' and 'personalized description' of content

After having the 'blueprint' of the content model, the next step is how to organize these contents - this is the responsibility of 'classification'. In AnQiCMS, each category mustand onlyBelongs to a specific content model.For example, you can create a category named "Industry News" and associate it with the "Article Model"; then create a category named "Smartphone" and associate it with the "Product Model".

This relationship is crucial because it determines that all future content (documents) to be published under this category will follow the field definitions of the content model it belongs to.For example, all articles under the "Industry News" category will have an "author" field; all products under the "Smartphone" category will have a "price" field.

However, the category itself, in addition to being the 'place of origin' for the content, also possesses some attributes and information.For example, the name of the category, introduction, SEO information, and even for the need of page beauty and content presentation, you can also set a "Banner image" or "thumbnail" for the category.Add custom field extra.For example, you can add a "Brand Introduction" field or a "Sales Manager" field under the "Product Model" category, so that each product category can have its own unique description information.

categoryListThe 'connector' role of the tag

Now, let's turn our attention to the template level. On your website's frontend page, you need to display these categories for navigation or browsing.categoryListThe tag is the powerful "connector" provided by AnQiCMS for this purpose.

When you usecategoryListFor example, when labeling{% categoryList categories with moduleId="1" parentId="0" %}You are actually giving commands to AnQiCMS:

  1. moduleId="1": Clearly tell the system that I need to listContent model ID is 1All categories under (for example, "Article Model"). This iscategoryListThe tag has the most direct association with the background content model settings. By specifyingmoduleIdYou can accurately obtain all categories belonging to a specific content model, thereby realizing independent display and management of different types of content categories on the front end.For example, you can only display article categories on the article list page, and only product categories on the product center page.
  2. parentId="0": it indicates that you want to retrieve the model undertop-level categories. You can also specify a specificparentIdto retrieve subcategories, or even useparentId="parent"To get the sibling categories of the current category, this reflects its flexibility in building multi-level category navigation.

WhencategoryListAfter the label is executed, it will return a list containing multiple category objects (in the above example, it iscategories). For each category object, you can access its built-in fields, such as:

  • item.IdCategory ID
  • item.Title: Category Name
  • item.Link: URL Link for Category
  • item.Description: Category Description
  • item.ParentId: Parent Category ID
  • item.Logo: Category Banner Image (if uploaded in the backend)
  • item.Thumb: Category thumbnail (if you have uploaded one in the background)
  • item.ArchiveCount: Number of documents included in the category
  • and,The category itself is defined by any custom fields defined by the associated content modelThis means that if you define additional fields (such as a text field namedcategory_sloganfor the entity “Classification” in the content model settingcategoryListthen each one traversed out will beitemAlso includesitem.category_sloganSuch properties, for flexible front-end calls.

Summary: The foundation of refined operation

In short,categoryListLabels and the classification fields related to the background content model exist in a mutually dependent mapping relationship. The content model defines the structure of the content and the fields that can be expanded for classification, while the classification itself specifies the concretization and hierarchization of the content model.categoryListThe tag is responsible for accurately extracting and presenting the structured, hierarchical classification information, along with the built-in and custom attributes it contains, on your website front-end.

This design pattern gives AnQiCMS great flexibility and customizability. It allows website operators to:

  • Display as needed:Based on content type (determined by the content model) filter and display related categories.
  • Customized presentation: By adding custom fields to categories, different categories can have unique descriptions and visual elements.
  • Optimize user experience and SEO: A clear classification structure and rich and accurate classification information, not only improves user navigation efficiency, but also provides a more friendly crawling path and richer content context for search engines.

Mastering this correlation, you can better plan the information architecture of the website, design more attractive and business-demand-oriented web pages, and stand out in the fierce online competition.


Frequently Asked Questions (FAQ)

  1. Ask: Can a category belong to multiple content models at the same time? Answer:Do not.In the design of AnQiCMS, each category is strictly limited to belong to only one content model.Once the category is created and the content model is selected, the association cannot be changed.This is to ensure the clarity and consistency of the content structure.

  2. Ask: If I define a new field (such as 'Article Summary') for the 'Article Model' in the background, then when usingcategoryListCan you directly access this 'article summary' field when listing article categories? Answer: categoryListThe tags directly list isThe category itselfand the properties it inherits through the content modelcustom fields of the category. It does not directly expose the custom fields of the documents under the category (such as "Article Summary"). If you need to access the custom fields of the document, you need tocategoryList

Related articles

How to limit the display quantity of each subcategory level when nesting multi-level categories?

AnQiCMS is an efficient and flexible content management system that excels in building structured content, especially its multi-level classification feature, which helps us clearly organize website content.However, when displaying multi-level category nesting, we often encounter a challenge: how to elegantly control the display quantity of each sub-category level to avoid the page being too long or the load being too heavy?As an experienced website operation expert, I am well aware of the importance of this requirement. Today, I will delve into the exquisite way to achieve this goal in AnQiCMS with everyone.

2025-11-06

Is the `categoryList` tag returning categorized data real-time from the database or does it have an in-built caching mechanism?

In the daily operation of website management, the speed and efficiency of data access are core elements of user experience and search engine optimization.For systems like AnQiCMS (AnQiCMS) that are dedicated to providing efficient and customizable content management solutions, whether the internal data processing mechanism, especially tags like `categoryList` that are frequently called, always directly query the database or have an intelligent caching mechanism, is a focus of many operators.

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

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

Can it be implemented to create a category list based on alphabetical index through `categoryList`?

As an expert who deeply understands website operation and is well-versed in all the functions of AnQiCMS, I often encounter various inquiries about the form of content presentation.TodayOn many content-rich websites, especially those that contain a large number of product categories, person entries, or professional terminology, there is a classified index list arranged in alphabetical order

2025-11-06

Does the `categoryList` tag output the `item.Content` field support automatic conversion of Markdown formatted content?

As an expert in website operations for many years, I deeply understand the intricacies of content presentation, especially in content management systems, how to flexibly and efficiently handle different formats of content is the key to improving website user experience and operational efficiency.Today, let's discuss a common question about AnQiCMS (AnQiCMS) content display: 'Does the `categoryList` tag output the `item.Content` field support automatic conversion of Markdown format content?'}]

2025-11-06

How to customize the `categoryList` in multi-level nesting, the character style and content before the child category `Spacer`?

As an experienced website operations expert, I am well aware of the importance of website navigation and content classification for user experience and SEO.AnQiCMS (AnQiCMS) with its flexible template engine and rich tag system provides us with powerful content display capabilities.Today, let's delve deeply into a detail that is common in multi-level category displays but often overlooked - how to customize the `Spacer` character style and content before the subcategory in the `categoryList` tag.### Perceiving the Beauty of Hierarchical Layers

2025-11-06

`categoryList`is there a difference or**practice**in the way it is called in the mobile template and PC template?

As an experienced website operations expert, I am well-versed in the powerful functions and essence of content operation of AnQi CMS, and I am delighted to delve into the calling method of the `categoryList` tag in the mobile and PC templates of AnQi CMS, as well as how to use its features to achieve efficient and user-friendly content presentation.On a day when content marketing and user experience are increasingly important, the performance of a website on different devices is crucial.AnQi CMS understands this, as can be seen from its project advantages and core features, it provides "adaptive, code adaptation"}

2025-11-06