After the page loads, is the `archiveFilters` tag dynamically generated or statically pre-generated?

Calendar 👁️ 62

AnQiCMS (AnQiCMS) is an enterprise-level content management system that focuses on efficiency, security, and SEO-friendliness. In the design of template tags, it fully embodies these concepts. Focusing on the issue ofarchiveFiltersThe label is dynamically generated as a filtering condition or statically pre-generated? This topic, we can delve into the unique features of AnQiCMS in handling such functions.

archiveFiltersThe mechanism of the tag: server-side pre-generated

To understandarchiveFiltersHow a tag works, first you need to clarify the underlying architecture of AnQiCMS.AnQiCMS is developed in Go language and uses a template engine syntax similar to Django.Server-sideThe HTML content has been rendered. The server will only send the generated HTML content to the user's browser once it is completely generated.

archiveFiltersThe label is a typical example of this server-side rendering process. From its usage{% archiveFilters filters with moduleId="1" allText="全部" %}...{% endarchiveFilters %}It can be seen that this is a standardTemplate Tag. At the template parsing stage of AnQiCMS, when the server processes toarchiveFilterstags, it will perform the following operations:

  1. For example, according to the parameters specified by the tag,moduleId(Model ID) and the context of the current page (such as category ID, URL query parameters, etc.), query all related document model custom fields and their optional values from the database.
  2. Build a data structure that includes all filtering conditions, this structure will include the name of each filtering parameter, the field name, and all optional values under it. For each optional value, the system will also generate the correspondingFilter link(usually a URL with different query parameters), and mark the currently selected option (IsCurrent)
  3. Name this complete data structure (in the example namedfiltersFill into the template and utilizeforLoop and other template syntax, directly embed these filtering conditions (including text labels, links, and selected status) intothe final generated HTML code.

This means that when the user's browser receives the page, all the filtering conditions - including the 'All' option, specific parameter values, and the corresponding clickable links - are fully present in the page's HTML source code.They are not generated by JavaScript code that is asynchronously requested after the page is loaded.

Why choose server-side pre-generation?

AnQiCMS chooses this server-side pre-generation method not by chance, as it is closely linked to the core advantages and design philosophy of the system:

  1. Ultimate SEO friendlinessFor a system like AnQiCMS that focuses on SEO optimization, it is crucial for search engine crawlers to directly capture the filtering conditions and the pages they may lead to.If the filtering conditions are generated dynamically through JavaScript after the page is loaded, search engine crawlers may not fully parse these contents, thereby affecting the inclusion and ranking of the website.The server-side pre-generation ensures that all filtering paths are visible in the initial HTML, greatly enhancing the SEO effect.
  2. Page load speed and user experience: Since all the filtering conditions are in the initial HTML, the browser can obtain the complete page structure and content on the first request, without waiting for additional JavaScript execution or data requests.This helps to speed up the first screen rendering, providing users with a smoother, seamless browsing experience.
  3. Manifestation of high-performance architectureBased on Go language, AnQiCMS is good at high concurrency and fast processing.Placing the generation of filtering conditions on the server side can fully utilize the high-performance advantages of the Go language, completing complex database queries and template rendering in a short time, thereby efficiently transmitting the complete HTML content to the client.
  4. Simplified and efficient template developmentFor template developers, using tags and loops directly in the template to output filtering conditions avoids writing complex client-side JavaScript code to handle data retrieval and DOM operations, making the template structure clearer and improving development efficiency.

Manifestation in actual operation

In actual use, when a user clicks on a button on the AnQiCMS websitearchiveFiltersThe following situations usually occur when filtering conditions generated by tags are applied:

  • The page will initiate a new HTTP request, the URL will include new filter parameters (such as?category_id=X&param_name=Y)
  • The server receives this new request and will query the database according to the parameters in the URL, re-render the page, generate a content list that meets the filtering conditions, and also updatearchiveFiltersThe corresponding option in the labelIsCurrentStatus, send the complete HTML page to the browser again.

Although modern front-end technology can also be realized through AJAX and other means for partial refresh, but it is the AnQiCMSarchiveFilterstags used to generate filtering conditionsstructure and initial contentIt still adheres to the server-side pre-generated strategy to ensure its SEO and performance advantages.

Summary

In summary, AnQiCMS'archiveFiltersis a tagstatic pre-generationIt is on the page when it is first loaded. The Go backend completes data query, logic processing, and HTML rendering on the server side, and directly embeds the complete filtering conditions and their corresponding links and statuses into the final HTML output.This design choice perfectly meets AnQiCMS's pursuit of SEO, performance, and development efficiency.


Frequently Asked Questions (FAQ)

  1. Q:archiveFiltersLabel pre-generated filtering conditions, whether it supports interaction through JavaScript, for example, to implement a click without jumping and only refresh the content locally?A:archiveFiltersThe tag itself generates HTML structure and links.Although its core is pre-generated on the server side, developers can completely use front-end JavaScript code (such as jQuery or Vue frameworks) after the page is loaded to intercept the click events of these filter links, and achieve local content refresh through AJAX technology, thereby avoiding a full page reload.But this belongs to the category of secondary development, AnQiCMS provides a complete page jump solution by default.

  2. Q: What are the specific benefits of this server-side pre-generated filtering method for my website's SEO?A: The main benefits lie inScalability and indexability.The search engine crawler can directly find and understand the structure of all filtering conditions and the URL they point to when accessing your page.This means that, whether it is the filter conditions themselves or the content pages filtered out through these conditions, there is a higher chance that they will be discovered, indexed, and included by search engines, thereby enhancing the search visibility of these pages.Content generated dynamically is often difficult to index effectively.

  3. Q: Can I customize?archiveFiltersThe appearance and style of the filter conditions generated by the label?A: Of course you can.archiveFiltersThe HTML content of the tag can be fully controlled by CSS styles.By defining the corresponding selector rules in the CSS file, you can freely adjust the visual properties such as font, color, background, layout, and so on of the filtering conditions.forLoop, you can also adjust the HTML structure at the template level to meet different design requirements.

Related articles

How to use the `archiveFilters` tag in Anqi CMS to implement multiple condition filtering, such as "house type" and "area"?

In today's information explosion in the online world, users' demand for information acquisition is becoming more and more accurate.A great website not only needs to have rich content but also needs to provide an efficient and convenient content filtering function to help users quickly locate the information they need.As an experienced website operation expert, I am well aware of the importance of refined filtering for improving user experience and website conversion rate.

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

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

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

If the `archiveFilters` tag does not display any filtering conditions, what are the common troubleshooting steps?

## AnQiCMS `archiveFilters` tag does not display filter conditions?Expert leads you step by step troubleshooting!As website operators, we fully understand the importance of a smooth and efficient user experience for the website.AnQiCMS provides the `archiveFilters` tag, which is to help us build this experience, it can dynamically generate filtering conditions according to the various parameters of the document, greatly enhancing the discoverability of content.

2025-11-06

Does the `archiveFilters` tag support filtering user-defined "content model custom fields"?

As an experienced website operations expert, I am well aware of the importance of the flexibility of a content management system (CMS) in efficient operations, and AnQiCMS, with its powerful content model customization capabilities, has provided us with great convenience in this regard.Today, let's delve deeply into a question that concerns everyone: Does AnQiCMS's `archiveFilters` tag support filtering custom fields of the content model?

2025-11-06

Under multi-site management scenarios, how does the `siteId` parameter of the `archiveFilters` tag ensure that the correct site's data is filtered?

As an experienced website operations expert, I am well aware that efficient and accurate content management is the cornerstone of success in a complex digital environment.AnQiCMS (AnQiCMS) takes advantage of its powerful multi-site management capabilities, providing great convenience for operators.However, with the increase in the number of managed sites, how to ensure that the data filtered in specific scenarios comes from the target site we want, rather than the current site or other irrelevant sites, this involves a crucial parameter in the `archiveFilters` tag - `siteId`.###

2025-11-06

What is the structure of the filtering link URL generated by the `archiveFilters` tag? Is it compatible with the pseudo-static rules?

As an experienced website operations expert, I often deal with various CMS systems in my daily work, and I know that every detail of a system is crucial in terms of content management, SEO optimization, and user experience.AnQiCMS (AnQiCMS) stands out in these aspects due to its lightweight and efficient features, especially the flexible use of template tags, which brings great convenience to website operations.

2025-11-06