In the template management system of AnQiCMS (AnQiCMS),config.jsonFiles play a crucial role, acting like an 'ID card' for a template, recording all the basic information and current status of the template. Among them,statusThe field is a key identifier used by the system to recognize whether the template is activated and in use.This field has only two possible values, each representing different meanings and purposes, which are crucial for the normal operation of the website and the flexible management of templates.

Status 1:status: 0(Not enabled)

Whenconfig.jsonin the filestatusField is set to0When this is the case, it indicates that the current template is in the "disabled" state.This means that the template already exists in the Anqi CMS system, but it is not the active template currently displayed to the public.In the operation of actual websites, this state template usually has multiple uses.status: 0To avoid affecting the normal access of the current online website.At the same time, some backup templates, seasonal templates, or simply installed备用templates in the system will also be set to the disabled status.This allows website administrators to plan, modify, and prepare the website appearance without affecting user experience.

Status two:status: 1(In use)

On the contrary, ifconfig.jsonin the filestatusField is set to1This indicates that the template is in the "In Use" state. It is the currently active, publicly accessible template on the website. When a user visits the website, the Anqi CMS system will use this template according to thestatus: 1using the identifier to load and render the content and layout of the corresponding template. In the design of Anqi CMS, a core principle is to ensure the uniqueness and stability of the website, therefore the system strictly regulates,In all templates, only one set of templates can bestatusthe value is set to1.This restriction ensures that the website has a consistent appearance and behavior pattern at any time, avoiding display errors or functional anomalies caused by conflicts between multiple templates.Website operators can easily switch between templates and update styles quickly or roll back templates in emergencies by toggling this status.

In short,statusfield is the core of the Anqi CMS template management mechanism, it0and1Two values clearly distinguish the active and inactive status of the template, thereby providing flexible and secure template deployment and switching capabilities.


Common Questions and Answers (FAQ)

How can I change or activate a new template in the AnQiCMS backend?

In the AnQiCMS management backend, there is usually a menu item related to 'Template Design' or 'System Settings'.After entering this page, you can browse the list of installed templates.The system will clearly display the current status of each template.To activate a new template, simply select the target template and click the corresponding 'Enable' or 'Set as Default' button.0(Not enabled), and change the status of the new template you select to1(In use).

2. If I mistakenly set the fields of multiple templatesstatusto the same value1What will happen?

The Anqi CMS system follows the principle of "Only one template can be used" in its designstatusThe value is 1". If inconfig.jsonManually modified in the file and caused multiple templatesstatusto the same value1The system may exhibit unpredictable behavior, such as loading one of the templates by default, reporting errors, or displaying parts of the page in a chaotic manner. To avoid this, please always perform template switching operations through the backend interface, and the system will automatically handle it.statusThe correct setting of the field. If this situation occurs, it is recommended to immediately change the status of all templates except the target template through the background.0.

3. Why do templates needconfig.jsona file to define their status?

config.jsonFile as a metadata carrier for templates, definitionstatusThe following reasons explain the field: Firstly, it provides a quick, unified way for the system to identify which template is currently active and which is the backup.Secondly, this file-based configuration method facilitates developers and operations personnel in directly managing and version controlling templates, especially in environments with multiple sites or continuous integration/deployment.Finally, it enhances the flexibility of template management, allowing the presentation logic of the website to be configured and switched without touching the core code.