In the template management system of AnQiCMS (AnQiCMS),config.jsonThe file plays a vital role, acting like an 'ID card' of a template, recording various basic information and current status of the template. Among them,statusThe field is a key identifier used by the system to recognize if the template is activated for use.This field has only two possible values, each representing different meanings and uses, which are crucial for the normal operation of the website and the flexible management of templates.
Status 1:status: 0(Disabled)
Whenconfig.jsonin the filestatusthe field is set to0When, this indicates that the current template is in an "disabled" state. This means that the template already exists in the AnqiCMS system, but it is not the active template currently displayed on the website.In the operation of actual websites, this status template usually has many uses.For example, a website operator may be developing a completely new template or making a major overhaul of an existing template, these templates in the development or testing phase will remainstatus: 0To avoid affecting the normal access of the current online website. At the same time, some backup templates, seasonal templates, or simply templates installed as backups 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 2:status: 1(In use)
On the contrary, ifconfig.jsonin the filestatusthe field is set to1This template is currently in use. It is the active, publicly accessible template of the website. When a user visits the website, the Anqi CMS system will use this template according to thestatus: 1An identifier is used 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 stipulates,In all templates, only one template set can be usedstatusThe value is set to1This restriction ensures that the website always has a consistent appearance and behavior, avoiding display errors or functional anomalies caused by conflicts between multiple templates.Website operators can easily switch the website from one template to another by toggling this state, enabling quick style updates or emergency template rollbacks.
In short,statusThe field is the core of the Anqi CMS template management mechanism, it is simple to use0and1Two values clearly distinguish between the active and inactive status of the template, thereby providing flexible and secure template deployment and switching capabilities.
Frequently Asked Questions (FAQ)
1. How can I change or activate a new template in the AnQiCMS backend?
In the AnQiCMS admin 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.The system will automatically change the status of the currently used template to0(Disabled), and change the status of the new template you have selected to1(In use).
2. If I mistakenly set multiple template'sstatusfields to1What will happen?
The Anqi CMS system follows the principle of "only one set of templates" in its design. If thestatusvalue is set to 1. Ifconfig.jsonManually modified in the file and caused multiple templatesstatusfields to1The system may exhibit unpredictable behavior, such as default loading of one template, error messages, or confusion in some pages. To avoid this, please always perform template switching operations through the backend interface, and the system will handle it automatically.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 background0.
3. Why do templates needconfig.jsona file to define their status?
config.jsonFile as the metadata carrier of the template, definesstatusThe field has several main reasons: First, it provides the system with a quick, unified way to identify which template is currently active and which is standby.Secondly, this file-based configuration method is convenient for developers and operators to directly manage and version control templates, especially in environments with multiple sites or continuous integration/deployment.Finally, it enhances the flexibility of template management, allowing the configuration and switching of the presentation logic of the website without touching the core code.