How to generate and control the pagination display effect of the `pagination` tag?

Calendar 👁️ 59

In website operation, when the amount of content is large, how to efficiently and beautifully display these contents while ensuring that users can browse conveniently is the key to improving user experience.If you dump all the content on the same page, it will not only load slowly but also make the visitor shy away.At this moment, content pagination becomes particularly important. It divides a large amount of information into several small pieces, both reducing the page loading burden and allowing users to explore the content they are interested in at their own pace, step by step.AnQiCMS provides a powerful and flexiblepaginationLabel, allowing us to easily implement and control the pagination display effect of website content.

paginationLabel Overview

AnQiCMS'paginationTags are designed to generate and control pagination navigation for list-type content (such as article lists, product lists, etc.). They are usually used with data list tags (such asarchiveListWork closely together to ensure that a complete set of pagination mechanisms is automatically generated when the list content exceeds the display limit of a single page. This means you do not need to manually calculate the number of pages or build complex URL logic,paginationThe label will help you take care of everything.

How to cooperatearchiveListTag usage

To makepaginationTo make the label work, first make sure your content list labels (such asarchiveList) have been configured to support pagination mode. InarchiveListIn the tag, the key is totypethe parameter topage. For example:{% archiveList archives with type="page" limit="10" %}. Here,limit="10"Defined the number of items displayed per page. Whentypeis set topagethen,archiveListNo longer just return a fixed number of list items, but prepare a paginated dataset forpaginationFurther processing of tags generates corresponding pagination links and page numbers.

paginationlabel'sshowParameter

paginationThe flexibility of tags is reflected in itsshowOn the parameter. This parameter allows you to control how many page number buttons are displayed in the pagination navigation. For example,show="5"means that up to a total of 5 page number buttons will be displayed before and after the current page number (excluding "Home", "Previous Page", "Next Page", "End Page").This design helps to keep the pagination navigation simple and avoid chaos caused by too many page numbers.

{# 假设我们有一个archiveList配合分页的数据集 #}
<div>
    {% archiveList archives with type="page" limit="10" %}
        {# ... 遍历 archives 显示内容 ... #}
    {% endarchiveList %}

    <div class="pagination">
        {% pagination pages with show="5" %}
            {# 这里将渲染出页码导航 #}
        {% endpagination %}
    </div>
</div>

paginationThe available fields inside the tag are explained.

paginationThe label will return a rich pagination information after executionpagesobject. Through this object, you can finely control every detail of pagination navigation:

  • TotalItems: All records in the current paginated dataset

Related articles

How to implement content aggregation and thematic display based on `tagList` and `tagDetail` tags?

In content management and website operations, how to efficiently organize and display content is the key to improving user experience and SEO performance.AnQiCMS provides powerful tag features, with the `tagList` and `tagDetail` template tags, it is easy to implement content aggregation based on tags and thematic display, bringing more flexible classification and richer navigation experience to the website.### The role of tags in content aggregation Tags are an important way to organize content in a content management system

2025-11-08

How to manage and display independent single-page content for the `pageList` and `pageDetail` tags?

In website operation, in addition to dynamically updated articles or product lists, we often need to display some relatively fixed and independent content pages, such as "About Us", "Contact Information", "Privacy Policy" or "Service Introduction" and so on.These pages are usually called "single-page content". AnQiCMS provides us with powerful and flexible tools for managing and displaying these pages, especially the core tags `pageList` and `pageDetail`.### Single Page Content: The Foundation of a Website Single page content is an indispensable part of a website

2025-11-08

How are the `categoryList` and `categoryDetail` tags used to build and display the hierarchical structure of the website?

In Anqi CMS, the classification hierarchy of the website is the core of content organization, which not only affects the user's browsing experience, but is also an important link in search engine optimization.To effectively build and display these classification structures, we mainly rely on two powerful template tags: `categoryList` and `categoryDetail`.They work together, allowing you to flexibly present clear and organized content categories on the website front-end.### Build the category list: `categoryList` tag `categoryList`

2025-11-08

How to retrieve and display the detailed information of a single document, including its custom fields, using the `archiveDetail` tag?

In a content management system, effectively displaying the detailed information of a single document is one of the core requirements.Whether it is news articles, product introductions, or service descriptions, users always hope to have a direct and comprehensive understanding of the specific content of each item.AnQiCMS provides a powerful `archiveDetail` tag, allowing you to easily retrieve and display all information of a single document, including your custom exclusive fields.### Retrieve the core information of the document: `archiveDetail`

2025-11-08

How to implement conditional display and loop display of dynamic content in AnQiCMS template using `if` and `for` tags?

In the Anqi CMS template world, `if` and `for` tags are the foundation for building dynamic and flexible pages.They give the template the ability to display content based on different data conditions, as well as the ability to efficiently loop through data sets, making your website content生动地呈现给visitors vividly.AnQi CMS adopts a template engine syntax similar to Django, making it easy for you, who is familiar with web development, to get started quickly, obtaining data through double curly braces `{{variable}}`, and using `{% tags %}` syntax for conditional judgment and loop control.### Use `if`

2025-11-08

How to format a timestamp with the `stampToDate` tag to display the date and time in a user-friendly manner?

In the daily content operation of Anqi CMS, we often need to present the original timestamp data such as publish time and update time in a way that is more accustomed to and easier to read for users.The original timestamp, such as `1609470335` such a pure number sequence, has no meaning to ordinary users.To solve this problem, AnQi CMS provides a very practical template tag——`stampToDate`, which can help us convert these numeric timestamps into a clear and user-friendly date and time display.###

2025-11-08

How to retrieve and display the global configuration and SEO information of the website using `system`, `contact`, and `tdk` tags?

In the daily operation of AnQiCMS (AnQiCMS), accurately displaying global configuration information, contact information, and carefully optimized SEO elements on the website front end is the key to improving user experience and search engine visibility.Fortunately, AnQiCMS provides several intuitive and powerful template tags that allow users to easily access this important data.This article will delve into the three core tags `system`, `contact`, and `tdk`, helping you seamlessly integrate the background configuration into various pages of the website.Get the global configuration of the website

2025-11-08

How to build and display the navigation path of the current page in the website using the `breadcrumb` tag?

In website construction and operation, user experience (UX) is always at the core.When visitors delve deeper into your website, a clear navigation path can effectively prevent them from getting lost and quickly understand their current location.This is the value of the 'Breadcrumb Navigation'.It not only enhances user experience, but is also an important part of Search Engine Optimization (SEO), helping search engines understand the hierarchy of your website structure.AnQi CMS knows this and therefore provides a convenient and easy-to-use `breadcrumb` tag

2025-11-08