In AnQi CMS, what is the role of the `moduleId` parameter in the `archiveFilters` interface?

Calendar 👁️ 76

When building a website with AnQiCMS, we often need to provide flexible filtering functions for different types of content so that visitors can quickly find the information they need according to their own needs.archiveFiltersThe interface is exactly for this, it can help us get the filtering conditions of the document. And in this interface,moduleIdthe parameter plays a crucial role.

archiveFiltersthe interface inmoduleIdDetailed explanation of the role of the parameter

When our website has a variety of content types, such as articles, products, service cases, etc., Anqi CMS will distinguish and manage these different types of content through 'models'.Each model can have its own unique fields, for example, the "product" model may contain fields such as "color", "size", "brand", etc., while the "article" model may only have "author", "publish date", etc.These custom fields are the basis for our content filtering.

archiveFiltersThe purpose of the interface is to return the list of all custom fields and their corresponding optional values under the model you specify. At this point,moduleIdThe parameters come into play.

To be specific,moduleIdThe parameter is used toSpecify the filtering conditions for the content model you want to retrieve. It is an integer representing a specific content model (such as,moduleId=1it could be the article model,moduleId=2Maybe it is a product model).

For example, suppose your website has a "Recruitment Information" module, which includes custom fields such as "City", "Education", and you associate this module with themoduleIdSet to 100. When you need to display these recruitment information filters on the front page, you can callarchiveFiltersthe interface and pass inmoduleId=100. The interface will base on thismoduleIdAccurately return the two filtering dimensions of "city" and "education level", as well as their respective options (such as city: Beijing, Shanghai; education level: Master, Bachelor, etc.).

If notmoduleIdThis parameter, the system will not know what type of content you want to get the filtering conditions for.Because different content models may have completely different custom fields and filtering logic, specify.moduleIdEnsured that the interface returns the filtering conditionsHighly relevant and accurateIt avoids incorrectly applying the 'product' filtering conditions to the 'article' content, thereby greatly improving user experience and data processing efficiency.

It's like a signpost, telling AnQi CMS: 'Please give me all the filter options for this specific content type.'This way, your website can dynamically display the most suitable filters for different categories or pages, making content organization and search more intelligent and convenient.For developers, this also means they can more easily build flexible and diverse frontend filtering interfaces without hardcoding a large amount of filtering logic.

Frequently Asked Questions (FAQ)

Q1: Where can I find a specific content model?moduleId? A1: moduleIdYou can view it on the content model management page of the AnQi CMS backend, usually each model will have a unique numeric ID. In addition, when callingarchiveListorarchiveDetailWhen the interface retrieves document or category information, the returned data will also includemodule_idfield, from which you can obtain the module ID of the corresponding document or category.

Q2: If I callarchiveFiltersNo interface providedmoduleIdHow will the parameters be? A2:As described in the API documentation,moduleIdIsarchiveFiltersinterface'sRequiredThis parameter indicates that if you do not provide this parameter, the interface will not respond normally, it will usually return an error message indicating that the necessary parameters are missing, or return an error code indicating that the request is invalid.This is to ensure that the system can accurately identify the content model you want to query.

Q3:archiveFiltersThe interface returns the filter conditions andarchiveListWhat is the relationship between the interface's custom filter parameters? A3: archiveFiltersThe interface returns exactlyarchiveListOptions for the "custom filter parameters" in the interface. In simple terms,archiveFilterstells you "which fields and options can be filtered", andarchiveListIt allows you to use these fields and options to 'actually filter out the document lists that meet the conditions'. For example,archiveFiltersIt might tell you that the "city" field has options like "Beijing", "Shanghai", and then you can add in thearchiveListrequest.city=北京Filter the documents in Beijing. They are a perfect match of building the frontend filter and executing the backend filtering logic.

Related articles

How to get the parameter filter condition list of a specified document model?

In website operation, providing users with a convenient content filtering function can significantly improve user experience and content discovery efficiency.The Anqi CMS provides powerful interfaces, allowing us to flexibly obtain and utilize these filtering conditions.Today, let's discuss how to get the parameter filtering condition list of a specified document model in Anqi CMS. ### The Importance of Understanding Filtering Criteria Imagine if your website has many products or articles, and users want to search based on dimensions such as "city", "education", or "product type".

2025-11-09

How to optimize the navigation experience of the previous and next documents through the `archivePrev` and `archiveNext` interfaces?

Today, with the increasing refinement of content management, every detail of a website may affect the reading experience of users.Among them, the navigation between the previous and next documents, as an important part of guiding users to continuously explore the website content, should not be overlooked in terms of convenience and fluidity.AnQiCMS (AnQiCMS) knows this and provides the powerful and intuitive interfaces `archivePrev` and `archiveNext` to help us easily implement and optimize this feature.###

2025-11-09

How should the comment area on the document detail page be integrated with the Anqi CMS comment API to display and publish comments?

In website operation, the comment area of the document detail page plays an important role, it not only promotes user interaction and enhances content activity, but also brings new content and search engine visibility to the website.AnQiCMS provides a powerful and easy-to-integrate comment API that allows you to easily implement comment display and posting features on your website.This article will discuss in detail how to use these APIs to create a fully functional comment system for your document detail page.##

2025-11-09

How to implement reading level control for specific documents (such as paid documents) in Anqi CMS?

In AnQi CMS, implementing a reading level control (`read_level`) for specific documents (such as paid documents or exclusive member content) is a very practical feature. It helps us better manage content permissions and achieve differentiated content operations.This mechanism is not only flexible, but also closely integrated with the user system, allowing us to determine what content users can see based on their identity or payment status. Next, we will explore how to efficiently use `read_level` in Anqi CMS to implement document access control.###

2025-11-09

What do the `name` and `field_name` in the `archiveFilters` interface represent?

During the development and content management process of Anqi CMS, we often need to handle document filtering and display.The `archiveFilters` interface was born for this purpose, it provides the ability to dynamically obtain filtering conditions.Understand the `name` and `field_name` fields in the returned data, which are crucial for building flexible and versatile front-end filtering functions.

2025-11-09

How to interpret the `items` array in the filtering conditions API, used to build the front-end filter?

In modern web design, the content filtering feature has become an important part of improving user experience and content discoverability.A well-designed filter can help users quickly locate the information they are interested in, whether it is products, articles, or any other form of content.For Anqi CMS, the provided filtering conditions API (/api/archive/filters) is the foundation for building such frontend filtering functions.Especially the `items` array in the response data is the key to understanding and implementing dynamic filtering.

2025-11-09

Why does the `total` field often display as 0 in the `archiveFilters` returned data? What is its real purpose?

When using AnQi CMS for website content management, we often deal with various API interfaces.Among them, the `archiveFilters` interface is an important tool for obtaining document filtering conditions.Many users notice that when using this interface, the `total` field in the `items` list of the returned data always displays as `0` for each filter option (such as `Beijing` and `Shanghai` under `City`).This may be confusing: Since it's a 'quantity', why is it `0`? This

2025-11-09

How to apply the filtering conditions obtained from the `archiveFilters` to the `archiveList` interface for document filtering?

In AnQi CMS, implementing the dynamic filtering function of documents is a key step to improve the user experience of the website.This usually involves close collaboration between two core interfaces: `archiveFilters` is used to obtain available filtering conditions, while `archiveList` is responsible for retrieving and displaying the corresponding document list based on these conditions.A deep understanding of how they work together can help us build flexible and user-friendly content filtering mechanisms for websites.### Understanding the Filtering Mechanism: From Definition to Discovery Imagine that your website has published a large number of articles

2025-11-09