How do the `archiveFilters` tag and `archiveList` and `pagination` tags work together to build a complete filter page?

Calendar 👁️ 55

AnQiCMS as an efficient and customizable enterprise-level content management system provides strong template tag support when building feature-rich websites. Among them,archiveFilters/archiveListandpaginationThese tags work together to help us easily build a filter page with an excellent user experience, allowing visitors to quickly locate the content they need.

Today, let's delve deeply into how these three tags complement each other to build a complete and dynamic content filtering system.

I. Starting point of the filtering:archiveFiltersTag

A high-efficiency filtering page needs to provide clear and flexible filtering conditions first. In AnQiCMS,archiveFiltersThe label plays this role. It can dynamically generate a series of filtering options for users to choose from based on the fields you customize in the content model.

Imagine you are running a real estate information website, where users may need to filter listings based on conditions such as 'House Type (apartment, villa)', 'Area (Haidian, Chaoyang)', 'Price Range', and so on.These filter conditions are not immutable, but are closely related to the fields in the 'House Model' defined on your backend.

archiveFiltersThe power of tags lies in the fact that it does not require you to manually hardcode each filter option. It will read the one you have set for a content model throughmoduleIdThe parameters specified) configure the filterable fields and display them. For example, if you define the "Color" and "Size" fields for the product model and set them as filterable, thenarchiveFiltersThe filter area for "Color" and "Size" will be automatically generated.

It generates an object containing multiple filter groups. Each group represents a filterable field (such as "Color"), and each group contains multiple specific options (such as "Red", "Blue").When the user clicks on a filter option,archiveFiltersIt will intelligently generate the corresponding URL, attaching the filter conditions to the query parameters of the URL. In addition, it can also passIsCurrentAttribute, intelligently judge which filter condition is selected, convenient for us to add highlight styles in front-end, enhance user experience.

Core function:Dynamically generate the filter condition interface and construct the filter parameter URL based on user selection.

Part two: The core content:archiveListTag

With the filter condition in place, the next step is to display the list of contents that meet the conditions.archiveListThe tag is the core tag used to retrieve the list of documents (or other archive content, such as products) in AnQiCMS.It can flexibly retrieve and display content based on various parameters.

In order toarchiveFiltersandpaginationwork together,archiveListthere is a crucial parameter setting:type="page". Whentypeis set topagethen,archiveListIt will enter pagination mode, which means it will retrieve data based on the pagination information and filter parameters in the current URL and return a paged result set.

When the user goes througharchiveFiltersSelected a condition, such as "Color: Red", a similar parameter will appear in the URL.?color=redThe configuration is set to.type="page"ofarchiveListIt will automatically parse these URL parameters, and retrieve the matching archive content based on the condition "Color is red." This means you do not need to write additional code to handle URL parameters,archiveListEverything has been done for you.

archiveListIt will also return detailed information for each item, such as title, link, description, thumbnail, views, and publish time, and this data can be found inforRender conveniently within the loop.

Core function:Dynamically retrieve and display a list of matching content based on the filtering and pagination parameters in the URL.

3. Smooth navigation:paginationTag

When the number of filtered content remains large, the pagination feature becomes indispensable.paginationwith the tag andarchiveList(type="page"mode) closely cooperate, providing users with intuitive and convenient page navigation.

paginationTags can be based onarchiveListReturn pagination information (total number, total pages, current page, etc.), generate “Home page”, “Previous page”, “Next page”, and specific page number links. More importantly, all the pagination links it generates willInherit automaticallyAll the filtering parameters in the current URL.

This means that whether the user clicks on a filter condition or jumps to the next page in the filter results, the original filter conditions will be retained.For example, the user filtered the 'red' product and clicked 'next page' in the results, then the products on the new page are still 'red' and the pagination function works normally.This seamless experience greatly enhances the user's navigation efficiency on the filter page.

paginationTags provide rich page information such aspages.TotalItems(Total number of entries),pages.CurrentPage(Current page number) as well aspages.Pages(The middle page number array) and others. We can use this information to build a beautiful and complete pagination navigation bar, and highlight the current page throughitem.IsCurrentthe attribute.

Core function:Provide navigation links for paginated content and automatically retain all filtering conditions.

Four, collaborative work: build a complete example of a filtering page.

Now, let's go through a simplified scenario to demonstrate how these three tags work together to build a complete product filtering page.

Assuming we have a product list page, we need to filter by the product's 'brand' and 'price range', and support pagination.

  1. Define the content model:In the AnQiCMS backend product content model, we have customized the 'Brand' (single selection) and 'Price Range' (single selection) fields and set them as filterable.

Related articles

How to understand the `archiveFilters` tag in the "document parameter filtering" function of the AnQi CMS template?

As an experienced website operations expert, I am well aware that how to efficiently organize and present information in an increasingly complex content ecosystem, while ensuring that users can easily find the content they need, is the key to enhancing the value of the website.AnQiCMS (AnQiCMS) with its flexible content model and powerful template system, has provided us with many tools to achieve this goal, among which the `archiveFilters` tag is undoubtedly a powerful tool for creating advanced content filtering functions. Today

2025-11-06

What content filtering needs are addressed by the `archiveFilters` tag in AnQi CMS?

As an experienced website operations expert, I know that how to help users efficiently find the information they truly need in the vast ocean of content is the key to improving user experience and website value.AnQiCMS (AnQiCMS) excels in content management, and the `archiveFilters` tag it provides is an important tool for solving this core content filtering need.In today's content-centric era, whether it is a corporate website, e-commerce platform, or vertical industry portal, the amount of content carried by the website is increasingly large.

2025-11-06

Lighting interaction: AnQiCMS website user comment management and display in-depth guide

In the digital age, websites are not only platforms for information release, but also important spaces for user interaction and communication.User comments are an indispensable part of the website content ecosystem, effectively enhancing user engagement, providing valuable feedback to content creators, and even driving the positive effects of search engine optimization (SEO).As an experienced website operations expert, I am well aware of the importance of an efficient and flexible comment management system for website operations.Today, we will delve into how to manage and display user comments on the AnQiCMS website, bringing vitality to your site. AnQiCMS

2025-11-06

How to configure the default language package and switch multi-language sites in AnQiCMS?

As an experienced website operations expert, I am willing to deeply analyze the powerful functions and practical strategies of AnQiCMS in default language package configuration and multi-language site switching.AnQiCMS is a system designed specifically for content management, and its multilingual support is one of its core advantages for expanding the global market and serving users of different languages.Understand and properly utilize these functions to give your website a powerful boost and accurately reach every target audience.--- ## In AnQiCMS, configure the default language package and easily switch between multilingual sites In the globalized digital age

2025-11-06

How to configure document model parameters in AnQi CMS backend for `archiveFilters` tag filtering?

In the vast sky of AnQi CMS, content operation experts often face a challenge: how to allow users to easily and quickly find the information they need?Especially when the structure of a website's content is complex, such as e-commerce products, real estate information, or various categorized articles, a flexible and efficient filtering mechanism becomes particularly important.Today, we will delve into how Anqi CMS can work in synergy with the powerful `archiveFilters` tag by cleverly configuring document model parameters to create a personalized content filtering feature for your website.

2025-11-06

What does the `archiveFilters` tag's `moduleId` parameter specifically refer to? How should it be properly specified to filter a specific model?

In website content operation, the organization and retrieval efficiency of content is the key to improving user experience and SEO performance.For sites with diverse content (such as articles, products, events, etc.), how to flexibly filter and display these contents has become a common challenge for operators and template developers.AnQiCMS is a system focused on providing an efficient and customizable content management solution, and its powerful template tag system is exactly the tool to solve this problem.

2025-11-06

How to customize the display text of the 'All' option in the `archiveFilters` tag or hide it?

As an experienced website operation expert, I am well aware that every detail in user experience and website customization may affect visitor retention and conversion.AnQiCMS (AnQiCMS) with its excellent flexibility, provides us with powerful content management capabilities.Today, let's delve into a common problem in front-end filtering functionality: how to elegantly customize or hide the default 'All' option in the `archiveFilters` tag.

2025-11-06

What is the structure of the `archiveFilters` tag returned `filters` variable? How to traverse the data within it?

AnQi CMS is an efficient and customizable enterprise-level content management system, playing a vital role in the content operation field.It not only provides powerful content publishing and management capabilities, but also through a series of flexible template tags, gives the website a high degree of customization and interactivity.Today, let's delve into one of the very practical tags - `archiveFilters`, and how it helps users accurately locate content in vast amounts, thereby significantly improving the user experience and content discovery efficiency of the website.

2025-11-06