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 and adapting to diverse operation requirements of the website.AnQiCMS as an efficient enterprise-level content management system, has shown excellent capabilities in this aspect. It not only supports multi-template switching at the whole site level, but also provides a detailed function to specify independent templates for specific pages or content types. This is undoubtedly a powerful tool for websites that need to carry out refined content operations.
Firstly, we need to understand the template system of AnQiCMS. All template files are stored centrally./templateIn the directory, each independent template package will have its own folder, which contains oneconfig.jsonconfiguration file. This file defines the template's name, version, author, and most importantly,template type.模板类型包括自适应(Responsive)、代码适配(Code Adapted)和PC+手机独立站点(PC+Mobile Separate Sites)。mobile/Subdirectory template files, thus achieving independent template rendering for mobile endpoints.In the background, switching and enabling different master templates is very intuitive; usually, it only requires simple selections in "Template Design" or "Global Settings.
The true strength of AnQiCMS lies in its granular template specification function.This allows website administrators to apply different designs to different pages flexibly based on content features or marketing objectives, without having to modify 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 Category
- 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.
news/list.html),而“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 automatically inherit this template setting for all subcategories under the current category, saving the trouble of repetitive configuration. - Document template:The AnQiCMS considers personalized needs for a single document just as carefully.In the interface for publishing or editing documents, there is a field called "Document Template".
special_report.html)。The system will prioritize the use of the template specified here to render the document, while ignoring the default template of its category or content model.
Specify an independent template for a single page
In addition to articles and products, websites usually also have independent single pages such as "About Us" and "Contact Information.AnQiCMS's “Page Management” feature also supports specifying independent templates for these single pages.When editing a single page, you can enter a specific template filename in the "Single Page Template" field.page/about.htmlThe exclusive template, making it stand out in design from other ordinary pages.
The intelligent template matching convention of AnQiCMS
Except manually specified in the background, AnQiCMS also has a set of intelligent template file naming conventions that can automatically match templates in specific situations, greatly improving efficiency:
- Document default custom template:As long as you have created a matching one in the template folder:
{模型table}/{文档id}.htmlThe file format, the system will automatically apply it to the corresponding document. For example, if your article model table isarticleand there isarticle/123.htmlThis file, the article with ID 123 will automatically use this template. - The default custom template for the document list:Similarly, for the category list page, you can create
{模型table}/list-{分类id}.htmlThe template file format, AnQiCMS will automatically match it to the corresponding ID category list. - Single page default custom template:For single page, the system will look for
page/{单页面id}.htmlFormat file.
These naming conventions mean that for some commonly used or fixed ID pages, you even do not need to enter the backend for configuration. Just place the template file in the correct position, and the system can automatically identify and apply it, which is very convenient for batch processing or fast deployment scenarios.
In summary, AnQiCMS provides great freedom to website operators through mainstream support for multi-template switching, combined with fine-grained specific page, category, and document template specification features, as well as intelligent template file naming conventions.Whether it is to adjust the whole station style 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, enhance user experience and the effectiveness of content marketing.
Common Questions (FAQ)
1. 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, ensure that each template package has an independent subfolder and a copy ofconfig.jsonConfiguration file.Then, log in to the AnQiCMS backend, navigate to the "Template Design" or "Global Settings" related pages, and you should be able to see the newly uploaded template in the template list.Select it and click Save or Enable.
2. 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 designed a good fault-tolerant mechanism. If you specify an independent template name for a category or document (for examplespecial.html), but the actual template folder does not existspecial.htmlFiles, the system will usually revert to the default template file for rendering. This is typically the case for detail pages of documents,{模型table}/detail.html; for category list pages,{模型table}/list.htmlTherefore, when specifying an independent template, be sure to ensure that the corresponding template file indeed exists.
3. Does AnQiCMS support using completely different templates for PC and mobile terminals?
Yes, AnQiCMS perfectly supports the use of different templates on PC and mobile endpoints.When you select a template, you can set the template type to 'PC + Mobile Independent Site' mode.mobile/Subdirectory. AnQiCMS