How to set the number of articles or products displayed per page in AnQiCMS?

Calendar 👁️ 72

In website operation, especially when managing pages that require a large amount of content display, such as article lists and product display pages, how to efficiently control the number of items displayed per page directly affects user experience and page loading speed.AnQiCMS provides a flexible and powerful mechanism to meet this need, it allows you to customize the display of each page according to different pages and content types through fine-grained control at the template tag level.

The AnQi CMS can provide this flexibility because it closely integrates the display logic of list content with template design.Not like some CMS may provide a global backend setting, Anqi CMS is more inclined to let you decide the specific behavior of each list when designing templates.The benefits of this design lie in the fact that you can set a small amount of content for the hot recommendation area on the homepage, and more content for the special topic list page, while also providing pagination for the related product list, truly realizing a personalized display of 'thousand stations, thousand faces'.

The core implementation mainly revolves around several key template tags, among which the most commonly used isarchiveListA tag that is responsible for calling a list of 'document' type contents such as articles or products. When you need to control the number of items displayed per page, archiveListlabel'slimitAn attribute is particularly important. For example, if you want to display 10 articles or products per page, just set it in the template forarchiveListtagslimit="10"properties.

just setlimitAn attribute, which usually only displays a fixed amount of content. If you not only want to limit the number of items displayed per page, but also need to generate 'Previous page', 'Next page', and specific page number navigation at the bottom of the page, then you need to cooperate witharchiveListThe other attribute of the tagtype="page". WhentypeSet to"page"then,archiveListNot only will it load the content of the current page according tolimitThe specified quantity, but it will also pass the total number of pages of the entire list, the current page number, and other pagination information to the system.

After that, you can usepaginationtags to receive these pagination data and render the full page number navigation on the page. By usingpaginationLabel, you can easily implement such features as displaying how many adjacent page numbers (show="5"), as well as common pagination elements such as 'Home', 'End', 'Previous', 'Next', etc., greatly enhances the convenience of users browsing a large amount of content.

exceptarchiveListLabel, similar content list tags in AnQiCMS, such astagDataList(Used to display a list of articles or products associated with a tag) andcommentList(Used to display the comment list), also follow the samelimitandtype="page"property rules to control the number of items displayed per page and pagination logic.

This setting method based on template tags gives website design and operation a high degree of freedom. For example, you may want to display the latest 5 articles in the article recommendation module on the homepage without pagination, and you just need to use{% archiveList archives with limit="5" %}And in a dedicated article category page, you may need to display 15 articles per page and provide complete pagination navigation, then you will use{% archiveList archives with type="page" limit="15" %}and pair with{% pagination pages %}.

Furthermore,limitThe property also supports a more advanced usage, namely bylimit="offset,count"The form, for examplelimit="2,10"This means the system will skip the first 2 items in the list and then display the next 10 items starting from the 3rd item.This is very useful for displaying several specially recommended items at the top of the page, and then displaying the rest of the content in a paginated form, making the layout more flexible and diverse.

In summary, AnQi CMS, through its powerful template tag system, delegates the control of displaying the number of articles or products per page to the template designer. Whether it's a simple content quantity limit or a complex content list with pagination features, it can be flexibly applied.limit/type="page"as well aspaginationTags can be easily implemented, thus providing users with a better browsing experience and helping website operators to better plan content display strategies.


Frequently Asked Questions (FAQ)

Q1: Does AnQi CMS have a global setting that can modify the number of items displayed per page for all lists at once?A1: The design philosophy of Anqi CMS is to provide high flexibility.Therefore, there is no unified global setting to control the number of items displayed per page in all content lists.This setting usually requires you to configure it in the template files of the website, separately for different content lists (such as article lists, product lists, tag lists, etc.), by modifying the corresponding template tags.limitTo implement properties. This method, although it requires some template editing operations, ensures that each list can be optimized according to its specific needs.

Q2: If I only want to display the latest/hottest few articles or products in a module without pagination, how should I set it up?A2: In this case, you just need to usearchiveList(or other content list tags liketagDataList)的limitProperty, and specify the number you want to display without adding anythingtype="page"Property. For example,{% archiveList archives with limit="5" order="views desc" %}It will display the top 5 articles or products with the highest views without generating any pagination navigation.

Q3:categoryListandpageListDoes the tag support pagination of display content?A3: categoryList(Category list) andpageList(Single page list) The tag'slimitProperties are mainly used to control the display quantity of themselves (i.e., categories or single pages), such as how many top-level categories are displayed.They do not provide direct in-page pagination functionality for articles or single-page content under the category.If you need to display articles or products in a category page with pagination, you still need to usearchiveListTag, and set it fortype="page"andlimitProperty.

Related articles

How to display the list of articles by category in AnQiCMS?

It is crucial to organize and display information efficiently in website content management.For users, being able to clearly browse article lists by different categories greatly enhances the access experience and also helps search engines better understand the website structure, thereby optimizing SEO effects.AnQiCMS (AnQiCMS) provides us with flexible and powerful tools, making this requirement easily accessible.

2025-11-08

How does AnQiCMS adapt the display of website content for PC and mobile endpoints?

AnQiCMS: Providing seamless PC and mobile end adaptive display solutions for your website In today's digital age, it is common for users to access websites through various devices, from large computer screens to small smartphones, and the display effect of the website directly affects user experience and the efficiency of information transmission.A website that cannot be displayed friendliness on mobile devices will undoubtedly lose a large number of potential users and business opportunities.AnQiCMS fully understands this requirement and has provided flexible and diverse solutions to ensure that your website content is perfectly presented on both PC and mobile ends

2025-11-08

How to use AnQiCMS built-in tags to control content display logic?

In AnQiCMS, the built-in tag system is the core tool you use to control the logic of displaying website content.It provides a powerful and flexible syntax that allows you to control the acquisition, filtering, sorting, formatting, and final layout of content in template files without writing complex backend code.This system is similar to the Django template engine syntax, easy to use, and can help you convert technical details into intuitive display effects.

2025-11-08

What template file extensions and storage locations does AnQiCMS support?

AnQiCMS as a flexible and efficient content management system provides powerful template customization capabilities.It is crucial to make full use of this advantage of AnQiCMS and understand the suffix and storage location of its template files.This can not only help you design websites more efficiently, but also locate and solve problems faster when encountering them.First, AnQiCMS template files use the `.html` suffix.This means that all template files you create or edit should be saved in HTML format. These`

2025-11-08

How to exclude content of a specific category from the article list?

In website content operation, we often encounter such needs: we hope to display most of the content on the article list page, but articles of certain specific categories are not listed here.For example, you may have a "Company Announcement" category that you only want to display on a separate page, or some articles for internal reference that you do not want to appear in the regular article list facing the public.AnQiCMS (AnQiCMS) provides a very flexible and intuitive way to handle this situation, allowing you to accurately control the display of content on the front end.The Anqi CMS through its powerful template tag system

2025-11-08

How does AnQiCMS filter and display content based on article recommendation attributes (such as headline, recommended)?

In content operation, effectively highlighting and displaying important articles is the key to improving user experience and guiding traffic.AnQiCMS (AnQiCMS) fully understands this point, therefore, it provides a flexible article recommendation feature, allowing you to mark it based on the importance of the content or specific use, and accurately filter and display it on the website front end.

2025-11-08

How to implement pagination functionality for article or product lists in AnQiCMS templates?

How to implement pagination for article or product lists in AnQiCMS template?For any content management system, effectively managing and displaying a large amount of content is a core requirement.When the number of articles or products on a website increases day by day, if there is no reasonable pagination mechanism, users may feel tired while browsing, and the website's loading speed may also be affected.

2025-11-08

How does AnQiCMS allow search results to be paginated on the page?

In AnQiCMS, implementing pagination for the website's search results is an important function for improving user experience and optimizing the website structure.AnQiCMS's powerful template tag system makes this process intuitive and efficient.By reasonably utilizing the `archiveList` and `pagination` core tags, you can easily build a functional search results page.

2025-11-08