AnQiCMSarchiveFiltersThe tag does not display the filter conditions? The expert guides you step by step to troubleshoot!

As website operators, we understand the importance of a smooth and efficient user experience for a website. AnQiCMS (AnQiCMS) providesarchiveFiltersThe tag, precisely to help us build this experience, it can dynamically generate filtering conditions based on the various parameters of the document, greatly enhancing the discoverability of the content. However, when you are filled with anticipation to bringarchiveFiltersLabel deployed to the template, but found the page empty, without any filtering conditions displayed, and we feel the confusion and anxiety in that moment.Don't worry, this is usually not a system failure, but some configuration details are not in place.archiveFiltersThe tag is reborn with vitality.

1. ConfirmarchiveFiltersIs the syntax and core parameters of the tag correct?

First, and the most fundamental step, we need to confirm.archiveFiltersIs the usage of the tag correct? Have you correctly introduced the tag in the template and passed the necessary parameters?

According to the AnQiCMS template tag document,archiveFiltersthe basic usage of tags is{% archiveFilters 变量名 with moduleId="1" allText="全部" %}. The most crucial parameter here is,moduleIdIt explicitly tells the system which content model you want to generate filtering conditions for. For example, if you want to filter the article model (usuallymoduleIdWith1), then your tag may look like this:{% archiveFilters filters with moduleId="1" allText="全部" %}Please verifymoduleIdDoes the value match the content model ID you want to filter (which can be viewed in the "Content Model" backstage).Sometimes, a small numerical error can cause the label to be unable to parse correctly or to not be able to obtain the filtering data of the corresponding model.

Also, pay attentionallTextThis parameter defines the default text for all options, such as "All". If you set it tofalseConfirm, if this 'All' option may not be displayed, this may sometimes give the impression that there are no filtering conditions.allTextThe settings meet your expectations, if you want it to be displayed, make sure its value is a string (for example"全部") rather thanfalse。“Furthermore,”siteIdThe parameter is optional in a multi-site environment, and if you do not specify or specify incorrectly, it may also affect the loading of filter conditions.

2. In-depth Content Model: Is the custom field configured and supported for filtering?

If the label usage looks fine, then our attention needs to turn to the core of AnQi CMS - the content model.archiveFiltersThe label can display filter conditions because it depends on the definitions you make in the content model.Custom fieldThese fields must not only exist but also havefilterable properties.

Please log in to the AnQi CMS backend, go to 'Content Management' -> 'Content Model', find the one you specified inarchiveFiltersspecified inmoduleIdThe corresponding model (such as "article model" or "product model"). Click edit to view the custom fields defined under this model. Here are several key points to confirm:

  • Does the custom field exist?Have you added custom fields such as 'region', 'house type', 'color', etc. to the model?archiveFiltersIt exists to filter these custom parameters, if there are no fields available for filtering in the model, it naturally cannot display any conditions.
  • Does the field type support filtering?Not all custom field types are suitable for beingarchiveFiltersThe filtering criteria. Fields such as 'single selection', 'multiple selection', and 'drop-down selection' usually provide clear options for users to choose from, they arearchiveFiltersThe ideal source of filtering criteria.Make sure you have provided specific "default values" (i.e., option values), as the system will generate filter options based on these values.archiveFiltersThe filtering criteria, because the system cannot automatically generate a fixed option list for it.
  • Are the field options complete?Ensure you provide enough options when defining fields of radio, checkbox, or dropdown types.If the option is empty, even if the field type is correct, the filtering condition cannot be generated.

In short, only when there is a well-configured and suitable custom field in the content model,archiveFilterscan the tags 'find' them and display them.

3. Has the document data been filled in with the relevant custom fields

Even if you have correctly configured the content model and custom fields, if there is no actual document data to 'fill' these filtering conditions, in the system,archiveFiltersIt will still be displayed as empty. For example, if you have set a "region" filter field in the content model, but all articles have not filled in the region information at the time of publication, or only filled in a single region, then the filter may only display