As an experienced website operations expert, I know that in today's era of content explosion, how to efficiently organize and present content so that users can quickly find the information they need is the key to improving user experience and SEO performance.English CMS (EnglishCMS) provides us with many operational tools with its powerful feature set.archiveFiltersThe feature injection adds more filtering vocabulary, thereby constructing a more intelligent and user-friendly content filtering system.
Use the 'Keyword Library' and 'Content Model' of the 'Security CMS'巧妙运用安企CMS的“关键词库”与“内容模型”:构建archiveFiltersA practical guide to the rich filtering system丰富筛选体系的实战指南
In a content management system, the content filtering function is like the navigation system of a website, directly affecting the efficiency and satisfaction of users in finding information. The content filtering function provided by Anqi CMS isarchiveFiltersTags, which are the core tools for building this 'navigation system'.However, to make full use of this tool, relying solely on the default settings is far from enough.We need to deeply explore the 'Keyword Library' and 'Content Model' functions of the security CMS, providing the filter with more accurate and richer filtering dimensions.
1. Deep understandingarchiveFiltersEnglish content filtering foundation
First, let us clearly understandarchiveFilters. According to the template tag document of Anqi CMS,archiveFiltersis specifically designed fortemplate for the document homepage or document classificationDesign, aimed at list combination filtering according to the various parameters of the document.It allows us to flexibly display various filtering conditions on the front-end page, such as 'house type', 'area', 'price range', etc., significantly enhancing user experience and providing an excellent opportunity for long-tail keyword SEO optimization.
The key point is here:archiveFiltersThe "Document Parameters" that depend on it are not directly sourced from the "Keyword Library" of the backend, butcustom fields defined in the content modelThis means, in order to enricharchiveFilterswe need to start with the content model rather than directly adding words to the keyword library.
2. "The real positioning and indirect value of the 'Keyword Library'
What role does the 'Keyword Library' of Anqi CMS play in this process? It is not directly forarchiveFiltersProvide front-end filtering options. On the contrary, the core value of the keyword library is reflected in the following aspects:
- Centralized management and standardization:The keyword library provides a unified place to manage the important keywords of the website, ensuring that content creators can use standardized, highly relevant vocabulary when publishing documents.This is crucial for maintaining the overall professionalism and consistency of the website.
- Content creation efficiency:In the "Publish Documents" interface, content creators can directly select keywords from the keyword library to avoid manual input and spelling errors, greatly improving work efficiency.
- SEO optimization foundation:Keywords in the keyword library are an important basis for SEO optimization.They can be used for the meta keywords of articles, anchor text settings in the content, and even through the "Full Site Content Replacement" feature, to batch implement the internal link deployment of keywords, thereby enhancing the relevance and weight of the page.
- Auxiliary content strategy:Through the analysis of the keyword library, operators can better understand the key direction of the website content and the hot spots of user attention, providing data support for future content planning.
Although the keyword library does not directly provide filtering options, it ensures that the content is annotated with keywords in a standardized and consistent manner.This consistency lays a good foundation for subsequent filtering through custom fields, because users may base their filtering on their understanding of these keywords.
3. EnglisharchiveFiltersFiltering system: The core lies in custom fields of the content model
To truly bearchiveFiltersProvide rich and practical filtering vocabulary, our focus is on the powerful Anqi CMSCustom fields of the content modelFunction. Safe CMS allows us to add as many custom fields as needed for different content models (such as articles, products, real estate information, etc.). These fields arearchiveFiltersIdentify and utilize various parameters.
The following are the detailed steps to build this system:
Define the screening dimensions and business requirements:Before we start the hands-on operation, we should first clarify what filtering conditions the website users may need.For example, for a website selling products, users may need to filter by 'brand', 'color', 'size', 'material', etc.; for a real estate website, it may be necessary to filter by 'area', 'house type', 'rental/sale type', 'renovation', etc.In-depth user research and market analysis is the key to this step's success.
Create custom fields in the content model:Enter the "Content Management" -> "Content Model Click on the "Content Model Custom Fields" under "Add Field", to create a custom field for each confirmed filter dimension.
- Parameter name:User-friendly, easy-to-understand Chinese name (such as “brand”, “house type”).
- Field call:English lowercase letters, which will be used to identify the field in the template.
FieldName[for example]brand/house_type). - Field Type:This is the most important step. In order to support
archiveFiltersthe dropdown or multi-select filter, we should prioritize:- Single selection (Radio):Suitable for mutually exclusive filtering options, such as “Type of Tenancy (Lease/Sale)”.
- Multiple Selection (Checkbox):Suitable for selectable filters, such as “Facilities” (parking spaces, garden, terrace).
- Dropdown selection (Select):适合选项较多但单选的筛选,如“Brand”、“Region”。
- Default value:Here, we need to preset all possible filter options.For example, if the field is "house type
archiveFiltersinItemsofLabel.
为文档内容填充规范化数据:After the custom field is created, these custom fields will appear in the "Other Parameters" collapsible box when publishing or editing the documents under the corresponding model.Ensure that content editors strictly fill in data according to the preset options (or standardized format).This is the basis for the normal operation of the filtering function, any irregular data may lead to the failure of filtering or inaccurate results.
在前端模板中调用
archiveFiltersTags:Now, we can use in the list page or category page template that requires filtering functionalityarchiveFiltersTag to display these custom filtering conditions. “`twig {# Example: Call the filter on the product list page #}<h3>商品筛选</h3> {% archiveFilters productFilters with moduleId="2" allText="不限" %} {# moduleId为产品模型的ID #} {% for item in productFilters %} <div class="filter-group"> <span class="filter-name">{{ item.Name }}:</span> {# 显示“品牌”、“颜色”等参数名 #} <ul class="filter-options"> {% for option in item.Items %} <li class="{% if option.IsCurrent %}active{% endif %}">