AnQi CMS is an efficient enterprise-level content management system that provides many flexible tags and functions for content display and management. Among them,archiveFiltersTags are often used by website operators to build complex document filtering interfaces due to their powerful filtering capabilities. However, many users may have a question when trying to build a filtering function: "archiveFiltersDoes the tag support filtering based on Tag tags, in addition to custom parameters? Today, let's delve into this issue.
archiveFiltersTag: Born for structured filtering.
Firstly, we need to clarifyarchiveFiltersThe core positioning and design purpose of the label. According to the Anqi CMS documentation,archiveFiltersLabel used for list combination filtering conditions based on document parameters, especially emphasizing its application in multi-condition, structured filtering scenarios such as when creating a real estate website, where you can filter by house type such as residential, commercial, commercial residential, and so on, and can also be supplemented by filtering by house size such as single room, one bedroom living room, two bedrooms living room, three bedrooms living room, and so on.
This means,archiveFiltersThe tag mainly focuses on those "custom parameters" defined in the background "document additional automatic configuration" with clear structure and optional values.These parameters usually correspond to the fields in the content model, and different options can be preset for users to select, thus achieving a detailed content filtering.When we usearchiveFiltersWhen labeling, it will iterate through these custom parameters, and for each parameter, it will generate a list containing the 'All' option and specific filtering values for the user to click and select. Finally, it will pass the filtering conditions to the backend through the URL query parameters to dynamically load and display the content.
Fromtag-/anqiapi-archive/145.htmlIn the parameter list, we can see that it supportsmoduleId(Model ID),allTextand all keywords textsiteId(Site ID) These parameters control the behavior of tags. However, among these parameters, there is no direct provision for specifying or identifying Tag tags, such astagIdortagName. The document also clearly states that, 'Filter parameters are only of list type.'type="page"Effective immediately, the filter parameters only need to be placed in the query parameters of the URL.In the additional automatic configuration of the document, fields that can be filtered are configured, and filtering of the document can be completed by attaching these fields to the query parameters of the URL.This further confirmsarchiveFiltersThe focus of the tag is on handling custom parameter filtering associated with the content model fields.
Tag label: an independent classification and filtering mechanism
How does the Tag label play a role in AnQi CMS?The Anqi CMS treats Tag as an independent 'linking method' that can establish connections between different content models and categories.The document has a special explanation of the management and use of Tag tags, such as inhelp-content-archive.mdIt is mentioned that you can add multiple tags to the document, tags are somewhat similar to topics, and can associate documents of the same type together in a way other than classification.
To support the content aggregation and filtering of Tag tags, Anqi CMS provides a specialtagList(Get Tag list) andtagDataList(Get the document list under a specified Tag) tag. In particulartagDataListThe tag is designed to “retrieve the document list of a specified Tag”, it allows us to base ontagId(Tag ID)to retrieve all associated documents. This means that the Tag label has its own complete, independent filtering and display logic.
In summary,archiveFiltersLabels and Tag labels play different roles in AnqiCMS.archiveFiltersMore focused on the multi-dimensional combination filtering of the structured custom attributes of the document, while the Tag tag provides a loose, thematic content aggregation method, and bytagDataListThe label is responsible for displaying and filtering its content.
The idea of implementing a combination filter of Tag with custom parameters
AlthougharchiveFiltersThe tag itself does not directly support filtering based on Tag tags, but this does not mean that we cannot implement a combination filter based on Tag and custom parameters.As website operations experts, we can always find flexible solutions.
One feasible approach is to take the filtering of Tag labels as the first step, bytagDataListLabel retrieves all document IDs under a specific Tag. Then, these document IDs are passed to a customarchiveListQuery (if the backend supports passing in a list of document IDs for filtering) and applying this on top of thatarchiveFiltersGenerated custom parameter filtering conditions. This usually requires some frontend JavaScript logic or backend secondary development to coordinate the two filtering processes.For example, after the user selects a Tag, the frontend first makes an asynchronous request for all document IDs under the Tag, and then attaches these IDs as hidden parameters toarchiveFiltersGenerated in the URL or submit the request again via AJAX, including all filtering conditions (including Tag ID).
Another indirect method is, if the number of Tag tags is not very large, and each Tag can be mapped to some custom parameters, then this mapping relationship can be pre-processed on the backend, or the Tag name or ID can be parsed to by custom URL routing rules, to map it toarchiveFiltersValues that can be recognized by custom parameters. However, this usually increases the complexity of the system.
Therefore, directly answer the main question of this article:archiveFiltersThe tag itself does not directly support filtering based on Tag tags, it is mainly used for handling document custom parameter filtering. Tag tags in Anqi CMS have an independent filtering mechanism, namelytagDataList.But by flexibly using the front-end logic and back-end data processing capabilities, we can still achieve the functionality to meet the needs of Tag and custom parameter combination filtering.
Frequently Asked Questions (FAQ)
archiveFiltersandtagDataListWhat is the essential difference between them?archiveFiltersThe tag aims to provide a multi-dimensional combination filtering interface and logic for the structured customization parameters of the document. It generates filtering conditions based on the predefined model fields and their optional values. WhiletagDataListThe tag is specifically used to retrieve the document list associated with a specific Tag tag, its core lies in aggregating content based on the unstructured, topic-oriented association method of Tag.Both serve different content organization and filtering dimensions.I can
archiveFiltersDo you use the name or ID of the Tag directly for filtering?No. According to the documentation of AnQi CMS,archiveFiltersThe tag filtering logic is based on the "custom parameters" configured in the backend content model.It does not directly recognize or process Tag tags. If you want to filter based on Tag, you should usetagDataList.How to implement a complex combination function in Anqi CMS that filters by both custom parameters and Tag tags?due to
archiveFiltersandtagDataListThe focus is different, you cannot directly combine the two through a single tag. But it can be achieved in the following way:- Front-end logic integration:First use
tagDataListGet the document ID list under a specific Tag, and then use front-end JavaScript to handle these document IDs andarchiveFiltersGenerated custom parameter filtering conditions are passed to the backend for comprehensive query. This may require backend API support to receive document ID lists for secondary filtering. - Backend customization development:On the backend of AnQi CMS, develop a secondary development, write custom logic to receive Tag ID and custom parameters, then execute a joint database query, and return the list of documents that meet the conditions to the front-end template.
- Indirect mapping:If the number of Tags is limited and there is a one-to-one or one-to-many mapping relationship with certain custom parameters, the Tag filtering can be converted into
archiveFiltersIdentifiable custom parameter filtering criteria. However, this method may not be suitable for all scenarios.
- Front-end logic integration:First use