The flexibility of AnQiCMS: How to handle multi-template switching and personalized page design

In a content management system, a flexible template mechanism is the key to maintaining the competitiveness of the website and adapting to diverse operational needs.AnQiCMS as an efficient enterprise-level content management system has demonstrated excellent capabilities in this regard. It not only supports multi-template switching at the level of the entire site but also provides detailed features for specifying independent templates for specific pages or content types. This is undoubtedly a powerful tool for websites that require refined content operation.

Firstly, we need to understand the template system of AnQiCMS. All template files are stored in/templateUnder the directory, each independent template package will have its own folder, which contains aconfig.jsonconfiguration file. This file defines the name, version, author, and most importantly,Template Type. Template types include Responsive, Code Adapted, and PC+Mobile Separate Sites.Choosing the appropriate template type is the first step in website construction, especially when you need to provide an independent optimized experience for mobile visitors, such as after selecting the PC+mobile independent mode, AnQiCMS will automatically identifymobile/A template file under the subdirectory, thus achieving independent template rendering for mobile terminals.In the background, switching and enabling different main templates is very intuitive, usually just a simple selection in "Template Design" or "Global Settings" is needed.

AnQiCMS is truly powerful in its fine-grained template specification feature.This allows website administrators to flexibly apply different designs to different pages based on content features or marketing objectives, without changing the entire site template.

Specify an independent template for a specific category and document

In content management, for example, on article list pages or product detail pages, we often encounter situations where special layouts are needed. AnQiCMS provides the option to directly specify templates in the 'Document Classification' and 'Publish Document' interfaces:

  • Category template:When you edit a category in the background, you will find a "Category Template" field.Here you can specify a custom template file for this category.For example, your "news center" category may need a concise news list template (such asnews/list.html),while the "product introduction" category may require a more visually striking product display template (such asproduct/showcase.html)。Furthermore, you can also check the 'Apply to subcategories' option to make all subcategories under the current category automatically inherit this template setting, saving the trouble of repeated configuration.
  • Document template:For personalized needs for a single document, AnQiCMS also takes full consideration.On the interface for publishing or editing documents, there is a "document template" field.If you want an article (such as an important white paper or an event detail page) to have a unique display page, just enter a custom template filename (such asspecial_report.htmlThe system will prioritize the use of the template specified here to render the document, ignoring the default template of its category or content model.

Specify an independent template for the single page

In addition to articles and products, websites usually also have independent single pages such as "About Us", "Contact Information", and so on.AnQiCMS's 'Page Management' feature also supports specifying independent templates for these single pages.When editing a single page, you can fill in the specific template file name in the "Single Page Template" field.For example, create one for the "About Us" pagepage/about.htmlA dedicated template that distinguishes it from other ordinary pages.

AnQiCMS intelligent template matching convention

In addition to manually specifying in the background, AnQiCMS also has a set of intelligent template file naming conventions that can automatically match templates in certain situations, greatly improving efficiency:

  • Document default custom template:If you create a file that conforms to the{模型table}/{文档id}.htmlformat in the template folder, the system will automatically apply it to the corresponding document. For example, if your article model table isarticle, and it existsarticle/123.htmlThis file, then the article with ID 123 will automatically use this template.
  • Document list default custom template:Similarly, for the category list page, you can create{模型table}/list-{分类id}.htmlThe template file format, AnQiCMS will automatically match it to the category list corresponding to the corresponding ID.
  • Default custom template for single page:For a single page, the system will search forpage/{单页面id}.htmlthe file format.

These naming conventions mean that for some commonly used or fixed ID pages, you even do not need to enter the background for configuration, just place the template file in the correct position, the system can automatically identify and apply it, which is very convenient for batch processing or for scenarios that require rapid going online.

In summary, AnQiCMS supports mainstream template switching, combines fine-grained specific page, category, and document template specification features, and intelligent template file naming conventions, providing website operators with great freedom.Whether it is to adjust the overall style of the site or to create a unique display form for specific content, AnQiCMS can provide a powerful and flexible solution to help your website better attract visitors, improve user experience and content marketing effectiveness.


Frequently Asked Questions (FAQ)

How to enable a new template package in AnQiCMS?

To enable a new template package, you need to upload the template file to the AnQiCMS installation directory first./templateIn the folder, make sure each template package has its own subfolder and a copyconfig.jsonConfigure the file. Then, log in to the AnQiCMS backend, navigate to the relevant pages of "Template Design" or "Global Settings", and you should be able to see the newly uploaded template in the template list.Select it and click Save or Enable.

2. What if I specify an independent template for a category or document but do not provide the corresponding template file, how will the system handle it?

AnQiCMS has designed a good fault-tolerant mechanism. If you specify an independent template name for a category or document (for example"), but the actual template folder does not existspecial.html)}special.htmlThe system usually falls back to the default template file for rendering. This is typically the case for document detail pages{模型table}/detail.html; for category list pages, it is{模型table}/list.htmlTherefore, when specifying an independent template, be sure to ensure that the corresponding template file actually exists.

3. Does AnQiCMS support using completely different templates for PC and mobile ends?

Yes, AnQiCMS perfectly supports the use of completely different templates on PC and mobile devices.When you choose a template, you can set the template type to the "PC + mobile independent site" mode.In this mode, you can create within a template packagemobile/Subdirectory. AnQiCMS