How does AnQiCMS set up independent templates for document categories?

Calendar 👁️ 57

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 highest priority template customization rights belong to a single document. In content operations, we occasionally encounter situations where we need to design a unique display template for a specific article or product detail page, such as a special marketing landing page or a detailed product introduction page.at 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 "most specific" settings have the highest priority, meaning that the template settings for a single document will override the category settings, and category settings will override the model default settings.
  • 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 settings of a single document have the highest priority.The design logic of AnQiCMS is that the most specific settings will override the more general settings.Therefore, this document will use its own specified independent template, rather than the unified document template set by 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 foundation for organizing and managing website content, closely linked to the content model, defining the structure and display of content together.It is crucial for website operators to clearly understand the relationship between classification and content models, especially regarding the issue of variability after creation.For the question 'Can the document category in AnQiCMS be changed to a different content model?'

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 daily website operation, efficient content management and optimization is the key to enhancing the influence of the website.AnQiCMS (AnQiCMS) fully understands the challenges faced by operation personnel and has specially provided a powerful batch keyword replacement function, aimed at helping us make precise and rapid adjustments to all site content in the most convenient way possible.As a long-term operator using AnQiCMS, I will introduce how to efficiently perform batch keyword replacement in AnQiCMS documents, keeping your content always up-to-date and optimal.

2025-11-06

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

In the daily content operation of Anqi CMS, we deeply understand the importance of content assets.To ensure the security and recoverability of user content, the AnQiCMS system is built with a complete document recycling station mechanism.This feature ensures that after the content deletion operation, the document will not disappear permanently from the system immediately, but will enter a buffer area, providing valuable opportunities for operation personnel to regret and recover.

2025-11-06