How does AnQiCMS set up independent templates for document categories?

📅 November 6, 2025 👁️ 89

As a professional who deeply understands the operation of AnQiCMS and has a profound understanding of website content operation, I know that refined content display is the key to attracting and retaining users.The flexibility of AnQiCMS in template management, especially the ability to set independent templates for document classification, is an important tool for us to achieve this goal.

In AnQiCMS, the setting of content classification templates is not a one-size-fits-all solution, it follows a step-by-step, hierarchical coverage logic.From the global default template, to the category list under the content model, to the exclusive template of a specific category, and finally to the independent display of a single document, AnQiCMS provides a comprehensive customization system to ensure that we can present the most appropriate visual experience and information structure to users based on different content attributes and marketing strategies.

Core Concept: Model-driven and Flexible Coverage

The core of AnQiCMS lies in its "content model"-driven architecture.Every content, whether it is an article, product, or other custom type, belongs to a specific content model.This model not only defines the structure of the content fields, but also provides the basic path for the organization of the template.On this basis, AnQiCMS allows us to customize and override templates at multiple levels, with the priority from low to high as: Global default template -> Content model default template -> Category list template -> Unified template for documents under categories -> Independent template for single document.This design gives operators great freedom, allowing for fine-grained control according to specific needs.

Level one: Site-level and model default template

In the AnQiCMS template system, the first is the default template at the site level. Each template package has a preset structure, such as the list page is usually set to default as{模型table}/list.html, and the document detail page is set to{模型table}/detail.html. Here,{模型table}Represented the name of the content model (for examplearticleRepresents the article model,productRepresented the product model). This means that all content belonging to the "article" model will default to use if not specified otherwisearticle/list.htmlAs a list template,article/detail.htmlAs a detail template. Similarly, the "product" model will use the defaultproduct/list.htmlandproduct/detail.html. This default mechanism ensures the basic display consistency of the website across different content types.

Level two: Custom list template for category exclusive

Further customization is reflected in the template settings of the specific category list page.When you want the content list of a certain category to have a unique layout or style, AnQiCMS provides two implementation methods.One is throughNaming conventionsFor example, if you have a category with ID 100 under an article model, you can create it in the template filearticle/list-100.html. The AnQiCMS system will automatically recognize and apply this template as the exclusive list page for this category. Another way is toManage categories in the background interfaceManually specify. When editing the category, find the "Category Template" field, where you can enter a custom template filename (such asspecial_article_list.html), as long as the template file exists in your template package, the system will use it first.

It is worth noting that there is also an option for 'Apply to subcategories' in the category settings.If you check this option, the list template set for the current category will be inherited by all its subcategories, thus simplifying the bulk setting work.

Level three: unified template under the category document.

In addition to the category list page, AnQiCMS also allows you to specify a detail template for all documents under a specific category.This is very useful in certain scenarios, for example, all product details under a certain product series need to follow a unified display style, or all articles under a special theme need to use specially designed layouts. InManage categories in the background interfaceIt will also have a 'document template' field. Here you fill in a template filename (for exampleproduct_details_fancy.htmlThen this category and all documents in the subcategories (if inheritance is enabled) will use this template for rendering when accessed, rather than the default detail template of the model.This provides strong support for maintaining the unity of certain types of content.

Level four: Custom template for a single document

The template customization priority belongs to individual documents. In content operation, we occasionally encounter situations where we need to design a display template for a specific article or product detail page, such as a special marketing landing page or a detailed product introduction page. In AnQiCMS'sDocument editing pageBy means of the "Other Parameters" field, you can directly specify a template file name (such asmy_unique_article.htmlThis setting will unconditionally override all lower-level template settings, ensuring that the document can be presented in its most unique way.

Special case: flexible application of single-page templates.

For "single-page" content (such as "About Us", "Contact Information", etc.), AnQiCMS also provides a similar template customization mechanism. By default, single pages will usepage/detail.htmltemplate. But like document classification, you can go throughNaming conventionsfor examplepage/about.htmlfor the "About Us" page, or evensingle-page admin backgroundSpecify a template in the "Single Page Template" field to achieve personalized display of a single page.This enables the design of static content pages to be flexible and varied, meeting the special needs of brand building.

adaption strategy for mobile template

In addition to the above template levels for content types, AnQiCMS also supports independent adaptation of mobile templates. By creating in the root directory of the templatemobileSubdirectory, and copy and modify the structure and files of the PC template, AnQiCMS can automatically call when detecting that the user is accessing through a mobile devicemobileThis means that regardless of how the PC end sets the category or document template, the mobile end can have its own completely independent template system to optimize the user experience.

Summary and Practical Suggestions

The template category setting function of AnQiCMS provides unparalleled fine control for website operators.By flexibly using these hierarchical template settings, we can easily meet various content display needs: from maintaining a unified site style, to creating unique user experiences for specific categories or topics, to creating exclusive visual presentations for individual key content.

In practice, I suggest you:

  • Planning comes first:Before starting content creation and template design, be clear about the display requirements of various contents and plan the hierarchical structure of the template.
  • Make good use of naming conventions:For content with many categories and structured, using naming conventions (such as{模型table}/list-{分类id}.html) can improve efficiency and maintain tidiness.
  • Note the priority:Remember that the setting of “**body” has **priority, that is, the template setting of individual documents will override the category setting, and the category setting will override the model default setting.
  • Thorough testing:After adjusting the template settings, be sure to thoroughly test on different devices and browsers to ensure the display meets expectations.

By using the powerful template customization capabilities of AnQi CMS, we can present content to target users more efficiently and accurately, thus enhancing user experience and promoting the overall operational effect of the website.


Frequently Asked Questions (FAQ)

Ask: If I set an independent template for a document and the category it belongs to also has a document template set, which template will be used in the end?Answer: In this case, the independent template setting of a single document has **priority. The design logic of AnQiCMS is that the **body** setting will override the **more general** settings. Therefore, the document will use its own specified independent template instead of the document template set uniformly for its category.

Ask: Can I set different templates for the list page of the same category and the document detail page under the category?Answer: Absolutely. AnQiCMS treats the 'Category List Page Template' and the 'Document Detail Page Template under Category' as two different template settings.You can specify the list page template separately in the category management (affecting the display of the content list of this category), as well as the default detail template for all documents under this category (affecting the independent page display of all documents within this category).

Ask: Will the settings of the mobile template affect the PC template? How do they work together?Answer: The mobile template and PC template are completely independent systems, they will not affect each other. When users access the website using mobile devices, AnQiCMS will prioritize detectionmobileThe corresponding template under the directory, if it exists, then use the mobile template;If not available, it may revert to the PC template (the specific behavior depends on your AnQiCMS version and configuration).This means you can provide a fully optimized experience for mobile users without worrying about interfering with the presentation of the PC website.

Related articles

How to configure the SEO title, keywords, and custom URL for the AnQiCMS document classification?

As an experienced AnQi CMS website operation person, I know the key role of each page in search engine optimization (SEO).The category page acts as the core of the website content architecture, and its SEO performance directly affects whether your content can be efficiently discovered by potential readers.Our strong and flexible toolset provided by Anqi CMS can help us accurately configure SEO titles, keywords, and custom URLs for category pages, thereby significantly improving the visibility of the website in search engines.

2025-11-06

How to add a subcategory under AnQiCMS document classification?

As a senior website operator for AnQiCMS, I am well aware of the importance of content structure for user experience and search engine optimization.A clear and logical content classification can not only help users quickly find the information they need, but also enhance the professionalism and weight of the website.In AnQiCMS, by reasonably setting subcategories, an orderly content system can be effectively constructed. ### Build Content Hierarchy: Add Subcategories in AnQiCMS AnQiCMS provides flexible and powerful categorization features for content management.

2025-11-06

Can the document classification in AnQiCMS be changed to a different content model?

In the AnQiCMS content management system, document classification is the cornerstone of organizing and managing website content. It is closely connected with the content model, defining the structure and display methods of content together. For website operators, it is crucial to clearly understand the relationship between classification and content models, especially the issue of variability after their creation. In response to the question of whether the document classification in AnQiCMS can change its associated content model, according to the design principles and functional implementation of AnQiCMS, the answer is clear and **: Once the document classification is created and its associated content model is determined

2025-11-06

How to add custom fields of AnQiCMS content model to the document editing page?

As a deep user of Anqie CMS website operator, I know that the flexibility of the content model is one of its core advantages.The AnQi CMS not only provides an efficient content management framework, but also allows us to easily expand and customize the content structure according to specific business needs, thus realizing personalized content input and management on the document editing page.

2025-11-06

Does the document category template setting inherit to its subcategories?

As an experienced CMS website operation personnel of an enterprise, I fully understand the importance of content structure and display method for user experience.In daily management, we often encounter issues related to the setting of classification templates, one of the core questions being: will the settings of the classification template be inherited by its subcategories?A deep understanding of this mechanism is crucial for optimizing website operation efficiency and ensuring consistency in content display. The answer is: By default, the template settings of a category in AnQi CMS will not be automatically inherited to its subcategories.

2025-11-06

How does AnQiCMS manage and filter the document list?

As a website operator who deeply understands the operation of AnQiCMS, I am well aware of the importance of efficient content management and accurate filtering functions for website operation.AnQiCMS provides a comprehensive and flexible solution for document list management and filtering, not only achieving intuitive operation on the backend interface, but also providing powerful customization capabilities on the template level to meet various complex content presentation needs.### AnQiCMS document list core management interface In the AnQiCMS backend

2025-11-06

How to perform batch keyword replacement for documents in AnQiCMS?

In the daily operation of websites, efficient management and optimization of content is the key to enhancing the influence of the website. AnQiCMS (AnQiCMS) understands the challenges faced by operators and has specially provided a powerful batch keyword replacement function, aimed at helping us make precise and rapid adjustments to the entire site content in the most convenient way. As an operator who has been using AnQiCMS for a long time, I will introduce in detail how to efficiently perform batch keyword replacement in AnQiCMS, so that your content always remains in the latest, **state. ###

2025-11-06

How long are documents in the AnQiCMS document recycling bin retained?

In the daily content operation of AnQi CMS, we fully understand the importance of content assets. To ensure the security and recoverability of user content, the AnQi CMS system is built with a complete document recycle bin mechanism. This feature ensures that after the content deletion operation, the document will not disappear immediately from the system, but will enter a buffer area, providing valuable opportunities for operation personnel to regret and recover. **AnQi CMS Document Recycle Bin Mechanism** The document recycle bin of AnQi CMS is a core content management function provided by the system, aimed at preventing content loss caused by accidental operations.

2025-11-06