Can the `archiveFilters` tag restrict some parameters to be available only under specific categories?

Calendar 👁️ 74

AnQiCMS as a powerful and highly flexible content management system provides many conveniences for operators in terms of content display and management. Among them,archiveFiltersLabels are the key tools for implementing dynamic content filtering. Today, let's delve into a problem that operators often care about: archiveFiltersCan the tag limit some parameters to only be available under specific categories?

Deep analysisarchiveFiltersThe operation mechanism of the tag

First, let's understandarchiveFiltersThe core role of the tag. As we can see from the documentation,archiveFiltersTags are designed to build dynamic document parameter filtering conditions. When your website content, such as real estate information, product lists, and so on, needs users to filter combinations based on various properties (such as house type, area, color, size, etc.),archiveFiltersLabels can be very useful. They can automatically generate filter options for the front end based on the document parameters you set, greatly enhancing user experience and content discoverability.

Basic usage is as follows:{% archiveFilters filters with moduleId="1" allText="默认" %}...{% endarchiveFilters %}. Here,moduleIdThe parameter clearly specifies which 'content model' it will target to obtain filtering parameters. For example,moduleId="1"Indicates the filtering parameters for the article model.

Core clarification: The relationship between Module and Category

To answer the question of whether certain parameters can be limited to specific categories, we need to clarify the relationship between the 'Content Model' (Module) and 'Document Category' (Category) in AnQiCMS.

In the design philosophy of AnQiCMS, the custom content parameters (i.e., those used forarchiveFiltersfiltering the "parameters") arebound at the content model (Module) levelThis means that when you add custom fields such as 'House Type', 'Color', 'Size', and so on to the 'Article Model' or 'Product Model' in the background, these fields will become potential properties of all documents under the content model.

And the 'Document Classification' is organized and subdivided under the 'Content Model'. A classification always belongs to a specific content model. Therefore, when you are using a classification page onarchiveFiltersWhen a label is used, it will default (or according to your specifiedmoduleIdparameter) to load the content model of the category it belongs toall defined filter parameters.

So, the direct answer is:archiveFiltersThe tag itself cannot pass its parameters (such as passingcategoryIdTo limit it to display only the filtering parameters专属 of a specific category. It always provides all filtering parameter options based on the associated "content model".

How to implement a 'look' category-specific filter?

AlthougharchiveFiltersTags are module-level in the underlying logic, but as a senior operation expert, we always have ways to present the effect of 'category exclusive filtering' on the front-end through flexible strategies. Here are several practical methods:

  1. Template-level control:This is the most commonly used and flexible method.

    • Use exclusive templates for different categories:AnQiCMS supports custom templates for each category. For example, you may have a "real estate category" usinghouse-list.htmltemplates, while a "news information" category usesnews-list.htmlTemplate.
    • Render selectively in the dedicated templatearchiveFilters:In the 'Real Estate Classification'house-list.htmlTemplate, you can fully render all the filter parameters related to real estate. And in the 'News and Information'news-list.htmlIn the template, you can choose not to renderarchiveFiltersTags, or only render a small amount of general parameters that are meaningful for news articles (if any).
    • CSS/JavaScript dynamically hide:Even if all module-level parameters are rendered, you can selectively hide some unrelated filter options on a specific category page by writing CSS or JavaScript code, thereby achieving the effect of 'category exclusive' visually.This method is not very elegant, but it is very practical in some complex scenarios.
  2. Refined design of the content model:

    • If the content differences between your different "categories" are huge, and the required filtering dimensions do not overlap at all, then it may be necessary to consider assigning them from the very beginningDifferent content modelsFor example, real estate information should have an independent "real estate model", and product information should have an independent "product model". Different models have their own independent custom field sets, so thatarchiveFiltersWhen calling different models, different filtering parameters will naturally appear. This method solves the problem from the perspective of system architecture, but requires good design in the content planning stage.
  3. UtilizearchiveListThe data filtering capability:

    • Even ifarchiveFiltersLists all module-level parameters, and the final filtering effect is still determined byarchiveListthe tag to complete.archiveListWhen processing filter parameters, it will only match based on the actual documents data existing under the current category. This means that if a document in a "news category" has never set the "house area" parameter, then evenarchiveFiltersThe label displays the 'House Area' filter option, and when the user clicks it, only an empty result is obtained, indirectly indicating that this parameter is not suitable for this category.Although this method does not have a clear 'hide', it can still guide the user.

Summary

Of Security CMSarchiveFiltersTags are a powerful tool that provides rich document parameter filtering functions based on content models. Although they cannot be used directly at the tag level to according tocategoryIdLimit the available parameters, but through clever template design, reasonable content model planning, and front-end presentation control, we can fully realize a filtering experience that meets specific classification needs, making website content management both efficient and flexible.


Frequently Asked Questions (FAQ)

  1. Ask: If my website has two types of content, articles and products, and they both need different filtering parameters, how should I set them up? Answer:**Practice is to create different "content models" for "articles" and "products" (for example, the system default article model and product model).Then define exclusive custom fields under their respective models (such as articles have "author", "source", and products have "color", "size").Thus, when you call on the article list pagearchiveFiltersIt will display relevant parameters based on the article model; when called on the product list page, it will display product parameters based on the product model, thus naturally achieving isolation.

  2. Ask: Can I only display the filter parameters I want on a category page and hide other parameters that are not relevant to this category? Answer:Can be. You can set a dedicated category template for this specific category. In this category template, you can manually selectively renderarchiveFiltersThe label outputs the filtered content, or use CSS styles (such asdisplay: none;) to hide unrelated filter options, thereby visually presenting only the filtering parameters related to the current category.

  3. Question:archiveFiltersDoes the displayed parameter automatically filter out filter values without content? Answer: archiveFiltersThe tag itself lists all the parameters defined by the content model and their predefined optional values (if the parameter type is single-choice, multi-choice, etc.). As for whether there is actual document content under a specific filter value on the specific page, this is determined by the user after the filtering operation, byarchiveListTags combined with database queries to complete.archiveFiltersMainly responsible for presenting “Options available for filtering”, whilearchiveListResponsible for “executing the filter and displaying the results”.

Related articles

How to use the `archiveFilters` tag to provide exclusive filtering options for different types of users (such as VIP users)?

In the vast field of website operation, providing customized content services for different user groups is a key factor in improving user experience, enhancing user stickiness, and even realizing content monetization.As an experienced user and operations expert of AnqiCMS, I know that its flexible and powerful functions are enough to support us in achieving these refined operational goals.Today, let's delve deeply into a very useful tag in AnqiCMS, `archiveFilters`, and focus on how to巧妙运用 it巧妙运用 it巧妙运用 it巧妙运用 it, to provide exclusive content filtering options for specific groups like VIP users.###

2025-11-06

Does the `archiveFilters` tag support setting the default value for filter conditions?

As an experienced website operations expert, I know that how to flexibly use various tags to meet complex business needs is crucial in a powerful content management system like AnQiCMS.Today, let's delve deeply into a common question about the `archiveFilters` tag: Does the `archiveFilters` tag support setting default values for filter conditions?Can AnQiCMS `archiveFilters` tag set the default value of the filter conditions?

2025-11-06

How can the `archiveFilters` tag help analyze user preferences and optimize content strategy in content operations?

As an experienced website operations expert, I know that how to accurately capture user needs and adjust content strategies accordingly is the key to whether a website can stand out in the vast ocean of Internet information.AnQiCMS (AnQiCMS) with its flexible and powerful functions, provides many tools for content operators, among which the `archiveFilters` tag is a key to understanding user preferences and optimizing content strategies.### `archiveFilters` label: The first window to understand user needs Today, digital marketing is becoming more and more refined

2025-11-06

How to ensure that the `archiveFilters` tag-generated filter links do not lead to duplicate page content being penalized by search engines?

As an experienced website operations expert, I am fully aware that while using the powerful functions of a content management system (CMS) to bring convenience to the website, we must also be vigilant about the SEO risks that may come with it.AnQiCMS (AnQiCMS) with its flexible content model and powerful template tags, provides us with great freedom in content display, among which the `archiveFilters` tag is one of its highlights, helping users easily build complex filtering functions, greatly enhancing the user experience.

2025-11-06

Does the `archiveFilters` tag automatically handle existing URL parameters when generating filter links to avoid conflicts?

## The `archiveFilters` tag of AnQi CMS: Harmonious Coexistence of Intelligent Filtering Links and URL Parameters In today's information explosion in the network world, the richness and interactivity of website content are crucial for attracting and retaining users.For corporate websites, vertical industry portals, or content-rich self-media platforms, how to allow users to quickly and accurately find the information they need is an eternal challenge.AnQi CMS deeply understands this, its powerful template tag system provides many solutions for it

2025-11-06

Does AnQi CMS plan to enhance the intelligent recommendation filtering function of the `archiveFilters` tag in future versions?

As an experienced website operations expert, I have accumulated rich experience in the practice of content management systems (CMS), especially in understanding the various functions and content operation strategies of AnQiCMS (AnQi CMS).Today, we will discuss a topic that many content operators and website developers are concerned about: Does AnQi CMS plan to enhance the intelligent recommendation filtering function of the `archiveFilters` tag in future versions??### `archiveFilters` tag's current capability analysis

2025-11-06

How to add independent titles or descriptions to each filter group of the `archiveFilters` tag?

As an expert in the operation of AnQiCMS, I am happy to answer your question about how to add independent titles or descriptions to each filter group in the `archiveFilters` tag.This can greatly enhance the user experience and make the website's filtering function more intuitive and friendly.

2025-11-06

How to design UI/UX for the `archiveFilters` tag when there are many filtering conditions to keep it clear and easy to use?

As an experienced website operations expert, I know that an excellent CMS system not only needs to provide strong backend functions but also needs to present the ultimate user experience on the front end.AnQiCMS (AnQiCMS) demonstrates tremendous potential with its high-performance architecture based on the Go language and flexible template tag system.Today, let's delve deeply into how to maintain a clear and easy-to-use page through clever UI/UX design when there are many document filtering conditions in Anqi CMS (implemented through the `archiveFilters` tag).

2025-11-06