As an experienced AnQi CMS website operations personnel, I fully understand the importance of template configuration for website presentation and user experience. Today, let's delve deeper into this topic.config.jsonin the filetemplate_typeField, how it finely controls the display mode of your website template.

In AnQi CMS, the core of each template package includes a namedconfig.jsonThe configuration file. This file is the "identity proof" of the template, defining the name, version, author, and other basic information of the template. Among them,template_typeThe field plays a crucial role, determining how your website responds to visits from different devices, thus providing the most suitable browsing experience for PC and mobile users.

The Anqi CMS provides three main template display modes, which are throughtemplate_typeConfigure the different values. Understanding these patterns and their applicable scenarios is the key to ensuring the efficient display of website content and optimizing user experience.

Adaptive mode:template_type: 0

Whentemplate_typeSet to0When, the template will adopt the 'adaptive' display mode.This means that the website will use the same set of HTML code and CSS styles, adjusting the layout and content automatically through responsive design techniques (such as media queries) to fit the screen size of the accessing device.No matter whether on PC, tablet or mobile phone, users will see the same content under the same URL, but the page will be optimized for the device characteristics.

The advantage of this model is that the maintenance cost is low, you only need to manage a set of template codes.For websites with relatively simple content structures, fast deployment, and a desire for a unified experience, adaptive mode is an efficient and practical choice.It simplifies the content publishing process because you do not need to create or adjust independent content versions for different devices.

Code adaptation mode:template_type: 1

Selecttemplate_type: 1Enable the 'Code Adaptation' mode, which allows you to achieve more flexible device adaptability within a single template package.In this mode, AnQi CMS can load specific code snippets or styles from templates based on the type of device accessing (such as through the user agent string).mobileDirectory, and place the local template files or style rules for mobile devices exclusively.

Computer + mobile phone independent site mode:template_type: 2

If your website needs to provide a completely independent and highly customized experience for both PC and mobile devices, then you willtemplate_typeis set to2It is an ideal choice to turn on the "Computer+Phone Independent Site" mode.In this mode, AnQi CMS will differentiate between PC and mobile users' visits, and may redirect mobile users to the independent "mobile end address" configured through the "global feature settings".Each site has its own independent template directory and content presentation logic.

The independent site mode grants website operators the greatest degree of design freedom, allowing for the creation of extremely optimized user interfaces and interaction processes for both PC and mobile devices.This is especially important for businesses whose content or features vary greatly across different devices, or require deep SEO optimization for specific devices.However, the maintenance cost of this model is also the highest, as it essentially requires you to manage and update two almost independent sets of website content and templates.

Understandingtemplate_typeThe different configurations and the mechanisms provided by the security CMS can help you make wise template choices according to your actual operating needs.Whether it is to pursue simplicity in maintenance or the ultimate device experience, AnQi CMS provides flexible solutions.


Frequently Asked Questions (FAQ)

1. How to activate or switch the template display mode of the website?To activate or switch the display mode of the template, you need to find it in the corresponding template folderconfig.jsonfile. Modify the followingtemplate_typeThe field is the required value (0, 1, or 2). At the same time, ensure that theconfig.jsonin the filestatusfield to1(in use), and all other templatesstatusfields are0(Disabled), because only one template can be in use at a time. After saving the file, Anqi CMS will automatically recognize the new configuration and apply it.

2. If you selected code adaptation or standalone site mode but did not createmobileWhat will the catalog be like?If yourtemplate_typeConfigured as1Or (code adaptation)2(Computer + mobile standalone site), but the template folder does not includemobileDirectory, the system may encounter problems when trying to load a template for mobile devices.The specific behavior depends on the template design and the system's default error-tolerance mechanism.In most cases, it may revert to the PC template display, which may lead to poor user experience on mobile devices, chaotic page layout, or missing features.mobileDirectory.

3.template_typeCan the field be modified at any time? What should be noted after modification? template_typeThe field can be modified at any time, but a comprehensive test must be carried out after the modification. Especially when switching from adaptive mode to code adaptation or independent site mode, since it involves the loading logic of mobile-specific templates, you need to ensuremobileThe directory and its internal template files have been set up correctly, and the "Mobile End Address" in the "Global Function Settings" (if in independent site mode) has also been properly configured.Any mode switch may affect the website's SEO performance and user experience, therefore it is recommended to perform thorough testing in a non-production environment and back up the website data and files before going live.