How to manage document categories and set exclusive templates in AnqiCMS?

Calendar 👁️ 57

Hello! As a website operator who has been deeply involved in AnQiCMS for many years, I am very clear about the importance of efficient content management in attracting and retaining users.Document classification is not only the skeleton of content, but also a key factor in user experience and search engine optimization.Today, let's delve deeply into how to manage document categories in AnQiCMS meticulously and set up exclusive templates for them.

The core role of document categories in AnqiCMS

In AnQiCMS, document classification is not just about content grouping, it is also the foundation of website architecture, user navigation, and SEO strategy.A clear and reasonable classification system can help users quickly find the information they need and improve the usability of the website;At the same time, it can also guide search engine spiders to efficiently crawl and understand the website content, thereby improving the performance of the website in search results.AnQiCMS provides flexible category management features, allowing operators to build personalized content structures according to business needs.

Practice of document classification management in AnQiCMS

Document classification management is an indispensable part of content operation daily work.On AnQiCMS backend, we can perform comprehensive add, delete, modify, and query operations on the website's categories through the 'Document Category' feature under the 'Content Management' module.

When we embark on creating a new category, we will encounter a series of key configuration items:

first, Document modelIt is the primary choice when creating a category. Each category must belong to a specific content model, such as "article model" or "product model".This needs to be paid special attention to because once the category is created and the document model is selected, this model cannot be changed anymore.This emphasizes the need to clarify the nature and attribution of content in advance when planning the classification structure.

secondly,Parent categoryAllow us to nest new categories within existing ones to form a hierarchical structure.This is crucial for building clear website navigation. For example, under 'News Center', you can create subcategories such as 'Industry Dynamics' and 'Company Announcements'.

Category NameIs the category title displayed on the front-end to the user, should be concise and clear, easy to understand. Coordinate withCategory introductionThese descriptions can provide more detailed information for categories, and they are often used as the Description tag content in TDK (Title, Description, Keywords), which has a direct impact on SEO.

In.In Chinese, we can still make more refined settings:

Display orderDetermines the sorting of categories in the front-end list, the smaller the number, the closer to the front the position is.

SEO titleandKeywordsProvided SEO optimization space for category pages, allowing us to set independenttitleandkeywordslabel content to better match the search engine's crawling requirements.

Custom URLIs an important part of the pseudo-static rule. Pseudo-static rules are enabled.{filename}or{catname}When in mode, the custom URL will take effect. AnQiCMS usually automatically generates a pinyin alias based on the category name as the default value, but the operator can manually modify it to ensure uniqueness and SEO-friendliness.

Banner imageandThumbnailIt provides support for the visual presentation of the category page. Operators can upload multiple images as the carousel banner for the category page, or specify one image as the thumbnail for the category, which is used to display in the list or navigation.

Category contentAllow us to add rich main content to the category page, which is very useful in some scenarios where a detailed introduction of the category is needed.

Set a dedicated template for the category

One of the most powerful customization capabilities of AnQiCMS is the ability to specify exclusive templates for document classification, which greatly enhances the flexibility of website design.

Default template rule

AnQiCMS has a set of built-in template naming conventions that can automatically match and apply templates. For the document list page, the default category template is usually{模型table}/list.htmlFor example, if a category belongs to the "article model", its default list page template might bearticle/list.htmlIn addition, the system also supports specifying a template for a specific category, for example{模型table}/list-{分类id}.htmlThis allows you to provide a unique layout for a specific category.

Configure a custom category template

In the 'Other Parameters' of editing the category, there is one namedcategory templateThe field. Here you can enter a custom template filename, for exampledownload.htmlThis means that when accessing the list page of the category, AnQiCMS will no longer use the default{模型table}/list.htmlInstead, it loads the one you specifieddownload.htmlPlease make sure that this custom template file exists in the template design package you are using, otherwise this category page will not open normally.

The placement of the template file

The custom template file needs to be placed in/templateThe current active template directory under the template folder. For example, if your template package name isdefault, then the custom templatedownload.htmlshould be located/template/default/under the directory, or placed according to the folder organization mode you choose{模型table}/download.htmlsuch a path.

template inheritance and subcategories

Below the "Category Template" field, there is also oneApply to subcategoryThe option. By default, the category template will not automatically inherit to its subcategories.If this option is checked, all subcategories under the current category (regardless of whether they have set a custom template), will uniformly use the custom template set by the parent category.This is very practical for the scenario where it is necessary to maintain the consistent style of the subcategory page.

document template under the category

In addition to setting the template for the category list page, AnQiCMS also allows you to specify a uniform template for all documents under a particular categoryDocument TemplateThis means that when you visit the details page of any document under this category, the system will use the template you set here, rather than the template that the document itself may specify (unless the document itself has more specific template configuration).For example, you can specify one for all product articles under the "Product Case" categoryproduct_case_detail.htmlThe template ensures that the display style of all product cases is unified. Similarly, the template file must exist.

Notes on template creation and application.

When customizing templates in AnQiCMS, there are several points that need to be emphasized:

Template files are uniformly adopted:.htmlsuffix, and stored in/templateIn the corresponding template package under the directory. Static resources such as CSS, JS, images, etc. should be placed in/public/static/In the catalog.

AnQiCMS template engine supports syntax similar to Django, variable usage{{变量}}for logical control such as conditional judgments and loops{% 标签 %}, and the corresponding closing tag is required{% end标签 %}. When creating custom templates, you will fully utilize these tags to dynamically render categories and document data. For example, using{% categoryDetail %}Tag to get category details or use{% archiveList %}Tag to get the document list under the category.

Make sure that all template files are saved in UTF-8 encoding to avoid garbled characters issues.

The configuration of custom URLs and pseudo-static rules is closely related.If your website has enabled pseudo-static, then the custom URL of the category will directly affect its access path.When setting a custom URL, ensure its uniqueness within the entire site.

Summary

By using AnQiCMS's flexible document classification management function and powerful custom template support, you can create a highly customized and user-friendly content display effect according to your website's brand image and operational strategy.This not only helps optimize the internal link structure and SEO performance of the website, but also can effectively attract and retain your target users through consistent and attractive visual presentation, helping the marketing and communication of corporate content.


Frequently Asked Questions (FAQ)

1. Why can't I change the document model of the category that has already been created?AnQiCMS was designed to tightly bind categories with content models.Once the category is created and the document model is specified, it cannot be changed.This is to ensure the consistency and stability of the data structure, to avoid errors or confusion in content display due to changes in model type.Therefore, it is recommended to plan in advance the type of content and corresponding model that the new category will carry before creating it.

2. What will happen if I set a custom template for the category, but the template file does not exist?If you specify a custom template in the category settings, but the file is/templateThe current active template package does not exist in the directory, so when accessing the category page, the system will not be able to find and load the template, which usually leads to the page not displaying normally and may even cause error prompts.Therefore, before configuring the custom template, make sure that the corresponding template file has been uploaded and placed in the correct path.

3. Have I set a "document template" for a category, can each single article in this category still have its own independent template?Can be. AnQiCMS provides a flexible template priority mechanism.If you set a 'document template' for a category (which is the default template for all documents under that category), it will serve as a general rule.However, when editing specific documents, you can still specify a more specific exclusive template for the individual document by using the "Document Template" field in the "Other Parameters" of the document.When accessing this document, AnQiCMS will load the template specified by the document itself first, rather than the template set at the category level, which allows for more precise customization of individual important content.

Related articles

How to operate the document recycle bin feature in AnqiCMS, and how long is the document retention period?

As a senior security CMS website operator, I am well aware that the core of content management lies in the management of the lifecycle of content, including creation, publication, and even the final deletion and recovery.AnQi CMS fully considered these operational needs from the beginning of its design, integrating a practical document recycle bin function to ensure the flexibility and security of content operations. ### Security CMS Document Recycle Bin Operation Guide In Security CMS, the document recycle bin provides an important content protection mechanism. It does not simply physically delete content, but adopts a "soft delete" strategy.

2025-11-06

How is the document thumbnail and SEO title set and effective in AnqiCMS?

As a website operator proficient in AnQiCMS, I am well aware of the power of content in the digital world and how to attract and retain users through carefully crafted content.In AnQiCMS, document thumbnails and SEO titles are an essential part of the content publishing process. They not only affect the visual presentation of the content but also directly relate to the performance of the content in search engines.Below, I will elaborate on how these two key elements are set and take effect in AnQiCMS.--- ###

2025-11-06

How to specify a custom URL and schedule content publishing in a document?

As a website operator who deeply understands the operation of AnQiCMS, I know the key role of high-quality content and efficient publishing mechanism in attracting and retaining users.In daily work, precise planning of content, control of the timing of release, and the friendliness of URLs are crucial for improving user experience and search engine performance.Below, I will combine the powerful functions of AnQiCMS to elaborately explain how to effectively specify custom URLs and schedule content publishing.

2025-11-06

What rich content editing features does the AnqiCMS document editor support?

As an experienced security CMS website operator, I am well aware of the core position of content in website operation.The Anqi CMS is designed to meet the content publishing needs of various websites, its document editor integrates a variety of practical functions, aiming to provide operators with an efficient, flexible, and feature-rich creative environment.These features not only cover basic text processing, but also extend to the management of multimedia content, the improvement of structured data, and the support of cutting-edge editing modes, greatly enhancing the efficiency and expressiveness of content production.In the core link of content creation

2025-11-06

How to customize fields in AnqiCMS content model and set their types and default values?

As an experienced AnQi CMS website operations manager, I am well aware of the importance of the flexibility of the content model for website operation efficiency and personalized content display.The powerful content model customization feature of AnQi CMS is instrumental in making it the preferred tool for small and medium-sized enterprises and content operation teams.Today, let's discuss in detail how to customize the content model fields in AnqiCMS and set their types and default values.

2025-11-06

How to manage and associate documents with tags in AnqiCMS?

As an experienced security CMS website operator, I am well aware of the core value of tags (Tag) in content management and user experience.It is not only an effective supplement to content classification, but also a key tool for connecting related information, enhancing the internal link structure of the website, and optimizing search engine performance.In AnQi CMS, the management of tags and document associations is designed to be intuitive and powerful, aiming to help operators efficiently organize content and enhance the convenience of user discovery.### Role and backend management of tags in AnQi CMS In AnQi CMS, tags are cross-category

2025-11-06

How to manage single page content and image video resources in the AnqiCMS background management?

As a website operator who deeply understands the operation of AnqiCMS, I know that efficient content management and optimization is crucial for attracting and retaining users.AnqiCMS with its concise and efficient architecture provides us with powerful tools to handle all aspects of the website.Today, I will elaborate on how to manage single-page content on the AnqiCMS backend, and effectively utilize images and video resources to enhance the content quality and user experience of your website.### Efficient Management of Single Page Content Single page, such as "About Us", "Contact Information", or "Service Introduction"

2025-11-06

What can be configured in the AnqiCMS global function settings for website basic information and security options?

As an experienced CMS website operation personnel in the security industry, I know that the foundation of a website lies in its perfect basic information configuration and reliable security protection.These global settings not only define the facade and identity of the website, but are also the key to ensuring the safe, stable, and efficient operation of the content.A enterprise CMS provides comprehensive and flexible configuration options, allowing operators to comfortably build and maintain their digital platforms. The detailed explanation of the global function settings of Anqi CMS, where you can configure the basic website information and security options.###

2025-11-06