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

Calendar 👁️ 62

As an experienced website operations expert, I know that every detail in user experience and website customization can affect visitor retention and conversion.AnQiCMS (AnQiCMS) provides us with powerful content management capabilities with its excellent flexibility.archiveFiltersThe default 'All' option in the tag.

In the operation, the filtering function of the website is a key to improve user navigation efficiency and accurate content positioning. It is from Anqi CMS.archiveFiltersThe tag is born for this, it allows us to generate dynamic filtering conditions based on various parameters of the document (such as product attributes, article types, etc.)When a user is faced with a bunch of filtering conditions, an 'All' option is usually essential, representing the default state when no filtering conditions are applied.However, in some scenarios, we may need to adjust the display text of this "All" to better fit the brand tone or simply hide it to optimize specific user interactions.

UnderstandingarchiveFiltersTags and their 'All' option

archiveFiltersThe tag is mainly used to build filters on document list pages or category pages.Imagine an e-commerce website where users can filter products by color, size, brand, etc., or a content portal where users can filter articles by article type, publishing year, etc.allTextParameter control.

Its basic usage is roughly as follows:

{# 在文档列表页或分类页中使用,moduleId指定内容模型,allText设置“全部”选项的文本 #}
{% archiveFilters filters with moduleId="1" allText="全部" %}
    {% for item in filters %}
    <ul>
        <li>{{ item.Name }}: </li> {# 筛选参数的名称,例如“颜色” #}
        {% for val in item.Items %}
        <li class="{% if val.IsCurrent %}active{% endif %}">
            <a href="{{ val.Link }}">{{ val.Label }}</a> {# 筛选值,例如“红色”、“蓝色” #}
        </li>
        {% endfor %}
    </ul>
    {% endfor %}
{% endarchiveFilters %}

In the above code,allText="全部"It is the core we need to focus on today. It defines the display text for the option representing no specific value selected under each filter parameter (such as "color

Custom text for the 'All' option display

The design philosophy of AnQi CMS is highly customizable, even for a seemingly fixed text, it provides us with an easy way to modify it. To customizearchiveFiltersUse the display text of the "All" option in the labelallTextassign the parameter to the new text you want to display.

For example, if you find that the word 'All' is not vivid enough on your website, or you want to use more specific words to guide users, such as changing 'All Colors' to 'No Limit Colors', or 'All Types' to 'All Articles', you can simply modify itallTextJust value.

Let's see an example:

{# 将“全部”选项的文本改为“所有内容” #}
{% archiveFilters filters with moduleId="1" allText="所有内容" %}
    {% for item in filters %}
    <ul>
        <li>{{ item.Name }}: </li>
        {% for val in item.Items %}
        <li class="{% if val.IsCurrent %}active{% endif %}">
            <a href="{{ val.Link }}">{{ val.Label }}</a>
        </li>
        {% endfor %}
    </ul>
    {% endfor %}
{% endarchiveFilters %}

Modify it this wayallTextThe parameter value is "All Content", and the "All" option for all filtering parameters on the front-end page will be displayed as "All Content".This flexibility allows us to make fine adjustments according to the overall style of the website and the language habits of the target user group, thereby enhancing the consistency and affinity of the user experience.

Hide the 'All' option

In certain specific user experience designs, you may want to completely hide the 'All' option.This might be because your filtering logic is very clever, the first filter option already includes the meaning of 'All', or you may want to replace the function of 'All' with other UI elements (such as a reset button).AnQi CMS also provides a simple way to achieve this.

If you don't want to display the 'All' option, justallTextThe parameter value is set tofalse. The system will automatically ignore this option during rendering and it will not be displayed on the front-end page.

The following is an example code to hide the "All" option.

{# 完全隐藏“全部”选项 #}
{% archiveFilters filters with moduleId="1" allText=false %}
    {% for item in filters %}
    <ul>
        <li>{{ item.Name }}: </li>
        {% for val in item.Items %}
        <li class="{% if val.IsCurrent %}active{% endif %}">
            <a href="{{ val.Link }}">{{ val.Label }}</a>
        </li>
        {% endfor %}
    </ul>
    {% endfor %}
{% endarchiveFilters %}

toallTextis set tofalseAfter that, no option indicating 'All' will appear under each filtering parameter.This approach is suitable for scenarios where filtering status is managed through other mechanisms (such as the first filter tag being the default 'No limit' state, or a clear 'Clear Filter' button being provided on the page), which helps simplify the interface and provide a more intuitive operation process.

Consideration for practical application

There are a few points to note when making these changes:

  1. Testing comes first:Any modifications to the template code are recommended to be made in the test environment, ensuring that the changes meet expectations and do not introduce new issues.
  2. User Experience:No matter whether you choose to customize the text or hide the "All" option, the core purpose is to optimize the user experience.Before making a decision, consider your target user's habits and the overall interaction logic of the website.
  3. Template File:These modifications usually need to be made in your theme template file located in/templatethe directory, usually the model list page or category page of.htmlPerform in the file. Make sure to modify the template you are currently using and backup the original file as a good habit.

Of Security CMSarchiveFilterslabel'sallTextA parameter provides a powerful and flexible control point that allows us to easily customize the filtering function.It can well meet our operational needs, whether it is to make the text more guiding or to make the interface simpler.


Frequently Asked Questions (FAQ)

  1. If I do not setallTextthe parameter, what text will be displayed by default?IfallTextThe parameter is not explicitly set, Anqi CMS will display the default 'All' text according to its internal conventions.As a rule, this default text is 'all'.allTextParameter, even if it is only used to use the default "All" text, this can enhance the readability and maintainability of the code, and avoid uncertainties that may arise from future system updates.

  2. Can I customize the 'All' option for a specific filter (such as the 'Color' filter) while keeping other filters default or hidden? archiveFilterslabel'sallTextThe parameter affects all the filtering parameters output by this tag. This means you cannot directly pass throughallTextParameters to customize a single filter. If you have such a refined need, you may need to combine with front-end JavaScript code, inarchiveFiltersAfter the label output is completed, modify or hide the text of specific HTML elements. Alternatively, consider writing a separate HTML structure for filters that require special handling when designing the template, without usingarchiveFiltersOutput uniformly.

  3. How can users clear the applied filter conditions after hiding the 'All' option?When you choose to hide the "All" option, it is essential to provide an alternative filtering clearing mechanism on the website front-end.The most common practice is to provide a 'reset filter' or 'clear all filters' button.Clicking this button should take the website back to a state where no filters have been applied (i.e., all filters are equivalent to the "All

Related articles

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 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

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

AnQiCMS as an efficient and customizable enterprise-level content management system provides powerful template tag support when building a feature-rich website.Among these three tags, `archiveFilters`, `archiveList`, and `pagination` work together to help us easily build a user-friendly filtering page that allows visitors to quickly locate the content they need.

2025-11-06

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 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

What do the `Name` and `FieldName` fields represent in the `filters` variable? How are they used in the template?

As an experienced website operations expert, I have a deep understanding of the importance of efficient and flexible template usage in content management systems (CMS) for website operations efficiency and user experience.AnQiCMS (AnQiCMS) offers us powerful content operation tools with its concise and efficient characteristics, especially its flexible template tag system, making content display as easy as pie.

2025-11-06

The `archiveFilters` tag generates each filter option (`Items`) and includes which available fields, such as `Label`, `Link`, `IsCurrent`?

As an experienced website operations expert, I deeply understand the importance of content organization and user experience for the success of a website.AnQiCMS (AnQiCMS) with its powerful content management and flexible template customization capabilities has become my powerful assistant in efficiently operating my website.Today, let's delve into the `archiveFilters` tag, especially the key fields included in each filter option (`Items`), which are the foundation for refined content filtering and optimizing user experience.

2025-11-06

Are the filtering links generated by the `archiveFilters` tag SEO-friendly? What built-in optimizations does AnQi CMS provide for this?

As an experienced website operation expert, I am well aware that in today's highly competitive online environment, the SEO-friendliness of the Content Management System (CMS) is the foundation for the success of the website.AnQiCMS is known for its efficiency and flexibility, and the `archiveFilters` tag it provides is a topic of concern for many operators, as it affects SEO and has built-in optimization strategies in generating filtering links.Today, let's delve deeply into this topic.

2025-11-06