What is the main difference between the `type="page"` and `type="list"` modes in the AnQiCMS document list interface?

Calendar 👁️ 72

When you are using AnQiCMS to build a website and need to retrieve document content from the backend, you will often encounter the document list interface (/api/archive/list)。This interface provides a very importanttypeThe parameter determines how you will retrieve and process the document list data. Deep understandingtype="page"andtype="list"The core difference between these two modes is crucial for improving website performance, optimizing user experience, and developing features more flexibly.

type="list" mode: Efficiently retrieve small-scale data

type="list"The mode is the default behavior of the document list interface. Its design philosophy lies inQuickly and lightly obtain a fixed amount of document contentInstead of focusing on the overall scale of the data, when you only need to display a small selection of content in a specific block of the website, such as the 'Latest Releases' on the homepage, the 'Hot Recommendations' in the sidebar, or the 'Related Articles' on the article detail page, this pattern becomes very efficient.

In this mode, you can make use oflimitparameters to precisely control the number of documents returned, for examplelimit="5"It will return the latest 5 articles. It is worth mentioning that,limitIt also supports a "offset" usage, such aslimit="2,10"This means you want to skip the first two records and then retrieve the next 10 documents starting from the third. This mechanism is very flexible in certain specific display scenarios.

However,type="list"The characteristics of the pattern also determine its limitations: it will not include the total number of documents in the returned data (totalfield), and does not support keyword search (qParameters and advanced filtering features such as custom filtering. This makes it unsuitable for scenarios that require pagination display or complex search filtering.

type=“page” mode: A tool for building complete pagination and search functionality

withtype="list"different,type="page"Mode designed forScenarios requiring complete pagination, search, and advanced filtering functionalityIt is designed. If you are building a blog list page, news archive page, or product showcase center, users need to be able to browse all content, perform pagination operations, and even search for information through keywords or specific attributes, thentype="page"The pattern is your first choice.

When you are going totypeis set to"page"At that time, the interface will not only return the document list data of the current page, but also provide an additionaltotalField clearly indicates the total number of documents that meet the query conditions. ThistotalThe value is the key to building front-end pagination navigation, allowing users to intuitively understand the overall scale of the content and easily jump to different pages.

Furthermore,type="page"The mode unlocks multiple advanced features. You can配合pageparameters to specify which page of content to retrieve, andlimittogether with parameters define how many documents are displayed per page. More powerful is,qThe parameter can be used in this mode for keyword search, helping users quickly locate documents with specific keywords in the title; at the same time, if you have configured custom filter fields for the document model in the AnQiCMS backend, you can also pass URL query parameters in the form of (for examplegender=男To implement more detailed custom filtering.

Overview of core differences

In summary,type="page"andtype="list"The main differences are reflected in the following aspects:

  1. Data returned:type="list"Only returns the specified number of documents, without the total count;type="page"Return the document list of the current page and providetotalthe total number of documents.
  2. Pagination support:type="list"not supportedpagePagination parameters;“type="page"SupportpageandlimitParameters to implement complete page turning function.
  3. Advanced Query:type="list"Does not support keyword search (q) and custom filtering;type="page"Fully supports these features, able to build more interactive list pages.
  4. Applicable scenarios:type="list"Suitable for quickly obtaining a small range of fixed quantities of display content, such as recommended positions;type="page"Suitable for pages that require a complete list of content, pagination browsing, search, and filtering.

In actual development, choose the appropriate one based on your content display requirementstypeA model that allows you to use AnQiCMS's data interface more efficiently, avoid unnecessary data transmission, and thus improve the loading speed and user experience of the website.


Frequently Asked Questions (FAQ)

Q1: Can I usetype="list"Do you want to use a pattern to get all the articles of the website?A1: It is not recommended to do this.type="list"The primary purpose of the pattern is to retrieve a small amount of data, it will not return the total number of articles, and fetching all articles at once may cause the request response to slow down due to the large amount of data, even resulting in timeouts. If you need to retrieve all articles and display them with pagination, you must usetype="page"Pattern.

Q2: intype="list"mode, limit="5,10"What does it mean?A2: limit="5,10"Indicate that you want to skip the first 5 records in the document list and start from the 6th record to get the next 10 document data.This is a "offset + quantity" retrieval method, which is very practical in certain specific local content display scenarios.

Q3: Why am I intype="list"mode and usingqparameters to search, but it did not work?A3: Keyword search (qParameters) and custom filtering features are designed fortype="page"patterns.type="list"The pattern focuses on simple, fixed-number content retrieval and therefore does not support these advanced query features. If you need to search or filter documents, be sure totypethe parameter topage.

Related articles

How to get the latest document list of the specified model (`moduleId`) through AnQiCMS?

In website content management, we often need to dynamically display the latest updates of a certain type of content, such as news articles, product releases, or blog updates.For websites built using AnQiCMS, leveraging its powerful API interface to obtain the latest document list under a specified model is a very basic and practical operation.This can not only help developers build dynamic pages quickly, but also provide users with timely updated information, optimizing the user experience of the website.To implement this feature, we mainly use the AnQiCMS provided

2025-11-09

How to dynamically build a frontend filtering UI based on the response of `archiveFilters`, such as dropdown menus or checkboxes?

In today's increasingly rich content of websites, how to allow users to quickly find the information they are interested in is a crucial operational issue.AnQiCMS provides powerful content management capabilities, and its API interface provides a solid foundation for front-end developers to build flexible and varied interactive interfaces.Today, let's delve into how to use the response data from the `archiveFilters` interface to dynamically build front-end filtering UI, such as common dropdown menus or checkboxes.The value of dynamic filtering interface Imagine that

2025-11-09

Does the `archiveFilters` interface require user login authorization to access?

In the daily application of Anqi CMS, the `archiveFilters` interface is an important tool for dynamically displaying filter conditions on the front-end page. It allows the website to generate various filter options based on the field configuration of the article model, such as "city", "education", and so on.It is crucial for building a user-friendly content browsing experience, where users can quickly locate content of interest through these filtering conditions.However, many developers may have a question when integrating: does this interface require user login authorization to access?To answer this question

2025-11-09

How to properly handle the error codes returned by the `archiveFilters` interface (such as -1, 1001, 1002)?

During the operation and development of the website, we often use various API interfaces provided by Anqi CMS to dynamically obtain and display content.Among them, the `archiveFilters` interface plays an important role, helping us to obtain the document filtering conditions, thus providing users with a more refined content browsing experience.However, correctly handling the error codes returned by any API is crucial to ensure the stable operation of the website and a smooth user experience.

2025-11-09

How to precisely control the number of documents returned and the starting offset of AnQiCMS document list (advanced usage of `limit` parameter)?

When building and managing website content, AnQiCMS provides a series of flexible API interfaces to help us accurately obtain and display data.Among them, the `archive/list` interface is the core for obtaining the document list, and its `limit` parameter demonstrates its powerful fine-grained control capabilities in terms of controlling the number of returned items and the starting offset.Understand and master the advanced usage of the `limit` parameter, which can make our website content display more flexible and efficient.### `limit` parameter basic usage

2025-11-09

How to implement descending order by publish time, view count, or update time in the AnQiCMS document list?

In website operation, how to efficiently present content lists so that users can quickly find the information they are most interested in or most valuable is an important issue.AnQiCMS provides a flexible document list feature, allowing us to easily implement content list sorting in descending order based on multiple conditions, such as publication time, page views, or update time.This not only optimizes the user experience, but also helps to improve the visibility and interaction of the content.

2025-11-09

How to filter the AnQiCMS document list to display articles under a specific category (`categoryId`)?

How to accurately filter out articles under specific categories when managing and displaying a large amount of content in Anqi CMS is a key link to improve the organization of website content and user experience.Strong and flexible interfaces are provided by AnQi CMS, allowing us to easily achieve this goal.This article will provide a detailed introduction on how to use the document list interface of Anqi CMS to only display specific categorized articles that you hope to see.### Master the document list interface: the core of content filtering To filter articles under specific categories, we need to use the `/api/archive/list` interface provided by AnQi CMS

2025-11-09

Does the AnQiCMS document list interface support excluding multiple categories of documents at the same time (`excludeCategoryId` usage)?

In website operation, we often need to flexibly display content, such as displaying the latest articles on a page, but not including content under certain specific categories, such as announcements or internal news.AnQiCMS as a powerful content management system, provides a rich set of API interfaces to meet these complex display requirements.Today, let's delve into a very practical parameter of the `archive/list` interface: `excludeCategoryId`, especially how it supports excluding multiple categories of documents.###

2025-11-09