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 website value. AnQiCMS, with its flexible content model and powerful template system, provides us with many powerful tools to achieve this goal, among which,archiveFiltersTags are undoubtedly a powerful tool for creating advanced content filtering functions.
Today, let's delve deep into the Anqi CMS templates.archiveFiltersUnderstanding the "Document Parameter Filtering" feature of the tag and how it helps us improve user experience and content management efficiency.
Unveiling the AanQi CMSarchiveFiltersTag: How to build a flexible and powerful document parameter filtering feature
In the digital age, users' needs for information are becoming more precise and personalized.A great website is not just a pile of content; it also needs to provide a convenient and intelligent filtering mechanism to help users quickly locate the content they are interested in.archiveFiltersTags are born to solve this pain point, giving the website the ability to 'filter document parameters', making your content list no longer flat and monotonous, but vivid and interactive.
Core Concept: What isarchiveFilters?
In short,archiveFiltersTags are a powerful tool in the Aiqi CMS template system, its core function lies inAccording to the various custom parameters in the document, dynamically generate filtering conditions available for user selection. This is different from the traditional filtering methods that only use categories or tags.archiveFiltersCan delve into the specific fields defined in your content model, such as product color, size, or property layout, area, etc., and convert these business parameters into intuitive filtering options on the front end.
The document explicitly states,archiveFiltersMainly applied toThe template on the home page or document classification of the document, and is often used in combination with the document pagination list.This means it usually appears on pages that require displaying a large amount of content and where users have specific filtering needs, such as product centers, case lists, news updates, etc.It acts like an intelligent shopping guide, able to adjust the display of content lists in real-time according to the specific preferences of users.
The content model of Anqi CMS andarchiveFiltersare closely integrated with
To fully understandarchiveFiltersThe power of it, we must first review the core advantage of the "Flexible Content Model" of Anqi CMS.The AnQi CMS allows us to customize content models according to business needs, for example, creating a 'Real Estate' model, where we can define custom fields such as 'Apartment Type', 'Area', 'Region', and 'Price'.
It is these meticulously defined custom fields in the background that becomearchiveFiltersThe foundation for playing a role. When you set a field (such as 'Layout') as a filterable parameter in the content model, archiveFiltersTags can intelligently identify and list all possible 'unit types' options (such as '1 bedroom', '2 bedrooms', '3 bedrooms') on the front-end page, and generate corresponding filter links for each option.
The cleverness of this mechanism lies in its seamless connection between the backend content structure and the frontend user interaction, greatly enhancing the manageability and flexibility of content display.
archiveFiltersLabel parameter parsing: precise control of filtering logic
archiveFiltersWhen a label is called, it usually comes with some parameters to finely control the behavior and display of the filtering:
moduleIdThis parameter is crucial, it is used to specify which content model's documents you want to filter. For example, if you want to filter documents under the 'Real Estate' model, you need to specify the correspondingmoduleIdThis ensures that the filter can load the correct custom field content model.allTextUser experience is often reflected in the details.allTextThe parameter allows you to customize the display text for default options such as "All" or "Unlimited". If it is set tofalseIf it is not necessary, the overview option can be hidden, which may be used in some specific scenarios.siteIdIf you are using the multi-site management feature of AnQi CMS and want to call or filter data across sites,siteIdParameters can be put to good use. It allows you to specify data filtering parameters for calling specific sites.
These parameters work together, allowing you to build a user filter interface that is both logical and aesthetically pleasing according to your actual business needs.
Deep understandingarchiveFiltersThe output structure: how to build the front-end interface
When you call a tag in a template and specify a variable name (such as)archiveFilters), it will return a well-organized data structure for you to loop through on the frontend. Imagine that,filtersfiltersVariables are like a box filled with filter categories, and each category contains specific filter options.
To be specific,filtersis an array object, each element representing a filterable 'parameter category', such as 'house type', 'area', etc. Each 'parameter category' object contains the following key information:
NameThis is the display name of the parameter category, such as 'House Type', 'House Size', etc., and is directly presented on the user interface.FieldNameThis is the backend content model field name corresponding to the parameter category, used for internal logic processing.ItemsThis is a deeper level array that contains all available filter values under this parameter category. For example, under the 'Type of Housing' category,Itemsit may include '1-bedroom', '2-bedroom', and so on.
whileItemsEach specific 'filter value' object in the array also includes the following properties:
Label: The display text of the filter value, such as 'One-bedroom', '50-70 square meters', etc.Link:This isThe most criticalIt is a complete URL link, clicking it will refresh the page and apply the filter condition.archiveFiltersAutomatically handles URL parameter concatenation to ensure the generated link is a usable filter result page.IsCurrentAn boolean value indicating whether the current filter value has been selected. This is crucial for highlighting the currently active filter condition on the frontend and providing visual feedback.
By cleverly utilizing these data, template developers can combineforloop andifjudge, easily building dynamic and responsive filter menus. For example, you can loopfiltersCreate a first-level filter title, and then nest a loopitem.ItemsList each filter condition and pass throughval.IsCurrentAdd for the currently selected itemactivestyles can be added.
Actual application scenario: make content filtering more magical
archiveFiltersThe practical application scenarios are very extensive, far beyond real estate websites.
- E-commerce websitesYou can use it to implement multi-dimensional filtering of products, such as filtering by 'brand', 'color', 'material', 'suitable audience', etc., greatly enhancing the user shopping experience.
- news media or blog:In addition to the traditional filtering by 'category' or 'tag', you can also filter by custom fields such as 'author', 'source', 'year of publication', or even 'article type' (such as in-depth reports, comments, and news flashes) to allow readers to find the content they are interested in more quickly.
- B2B Industry WebsiteThe demonstration cases can be filtered by 'industry', 'solution type', 'project scale', and other criteria to help potential customers quickly find services that meet their needs.
This parameter filtering flexibility not only enhances user experience, but also helps with SEO optimization. ThrougharchiveFiltersAn URL generated with specific parameters, which can be crawled and indexed by search engines, thus benefiting the website