In the daily operation of Anqi CMS, we often need to adjust the appearance and layout of the website, which usually involves switching or enabling different templates. Anqi CMS provides an intuitive and efficient way to manage the enable status of templates, which is mainly through the directory under each template.config.jsonin the filestatusfields.
config.jsonFile: Statement of Identity Template
Each AQS CMS template has a dedicated configuration file namedconfig.jsonIt is located in the root directory of the template (for example,/template/your_template_name/config.jsonThis file is like the 'ID card' of the template, recording the basic information and configuration parameters of the template. In addition to metadata such as template name, version, and author, config.jsonIt includes a crucial field -statuswhich directly determines the current usage status of the template.
statusField: The template's enable switch
statusThe field is the key to controlling whether the template is activated. It accepts two optional integer values:
0(Not enabled): whenstatushas a value of0When set to auto, it indicates that the template is currently disabled. Although it exists in the system, it will not be loaded and rendered by the website front-end.1(In use): whenstatushas a value of1When this value is set to auto, it means that the template is currently being used by the website. The Anqi CMS will load and parse this template when rendering the front-end page.
Here is a very important principle that needs to be remembered:In the AnQi CMS, there can only be one template at any timestatusthe value is set to1This is a mandatory constraint in the system design, ensuring that only one clear template is activated on the front end of the website at all times, thus avoiding potential conflicts and inconsistencies.
How toconfig.jsonEnable template
To enable a template, you need to go to the server'stemplatedirectory, find the folder of the target template. Open theconfig.jsonfile inside to edit.
For example, if you want to enable a template named "my_new_template", you need to follow these steps:
- Navigate to:
/template/my_new_template/directory. - Open
config.jsonfile. - Find
statusfield, and set its value to0Change to1. - Important Notice: Before applying the new template,
statusset1Before, you must ensure (or the CMS system will enforce) that the other template currently being used isstatusthe value has been set to0If you are manually editing the file, please make sure to replace the old template firststatusset to0and then set the new template as1to follow the principle of 'only one template can be used at a time'. - Save
config.jsonfile. - To ensure that the system can identify and load new template configurations in a timely manner, it is recommended that you perform a 'Clear Cache' operation in the Anqi CMS backend to clear old cache data.
Complete these steps and your website front-end will start usingmy_new_templateto display content.
How to disable the template
The process of disabling the template is simpler, just need to set theconfig.jsonin the filestatusfield value of the corresponding template to1Modify back0And of course, before you disable the currently used template, you need to make sure that another template has been successfully enabled (i.e., itsstatusThe value is1Otherwise, the front-end of the website will not display normally.
Passconfig.jsonin the filestatusField, Anqi CMS provides a clear and controllable template management mechanism for website operators, making the switching and maintenance of templates efficient and orderly.
Common Questions and Answers (FAQ)
1. If I accidentally edit manuallyconfig.jsonfiles, will multiple templates bestatusset as1, how will AnQi CMS handle it?
The Anqi CMS system strictly requires that only one template is in use at a time. If you manually editconfig.jsonthe file, you may accidentallystatusset all values to1English, the system will select a template based on its internal logic to load as the activity template, usually choosing the first one it scans that is set to1The template, or according to other established priority rules.To avoid unpredictable behavior, it is strongly recommended that you switch templates through the 'Website Template Management' feature in the Security CMS backend, as the backend interface will automatically handle this uniqueness constraint to ensure that only one template is activated.
2. In addition to direct modificationconfig.jsonFile, can I enable or disable the template through the Anqi CMS backend management interface?
Yes, Anqi CMS provides a convenient backend management interface for handling the enablement and disablement of templates.Under the "Template DesignThrough this interface, you can directly see all the installed templates and their current status, and you can safely click the button to switch to the active template.config.jsonin the filestatusThe field should be set to 'In Use', and ensure that only one template is set as 'In Use', which is safer and more convenient than manual file editing.
3. I have modifiedconfig.jsonofstatusField has been saved, but the front-end of the website did not update to the new template immediately, why is that?
After modifyingconfig.jsonAfter the file, if the website front-end does not immediately display the new template, there may be several reasons.Firstly, the AQ CMS system usually uses caching to improve performance.You may need to perform an "Update Cache" operation in the background to ensure that the system loads the latest configuration.config.jsonfile, and the new template'sstatusvalue is indeed1, while ensuring other templates'statusis no longer1.The cache of the Nginx or Apache and other Web servers may also need to be refreshed.If the issue still exists, checking the server logs usually provides more detailed error information.