Which folder under the website root directory must all template files be stored in?

Calendar 👁️ 70

As a website operator who deeply understands the operation mechanism of AnQiCMS, I know that the template structure of the content management system (CMS) is crucial for the display, maintenance, and optimization of the website.A clear and standardized template file storage rule is the cornerstone of ensuring the efficient operation and smooth release of website content.

In the Anqi CMS system, all template files used to build the front-end interface of the website are stored in specific locations. These template files, regardless of their purpose, whether it is the homepage layout, article detail page display, or category list presentation, must be uniformly placed in the root directory of the website./templateIn the folder. This is the unique entry point for the Anqi CMS system to identify and load templates. Any file that deviates from this path will not be correctly parsed and rendered by the system.

To achieve modular management and flexible switching of multiple templates, Anqi CMS further standardized/templatethe internal organizational structure of the directory. Each independent website template needs to be/templateThe directory has a dedicated subfolder. For example, if you are using a template named "default", then all.htmlThe template files will be stored in/template/defaultUnder the path. This subfolder will also contain aconfig.jsonFile, it is the 'ID card' of the template, recording the name, version, author, description, and the supported template types (such as adaptive, code adaptation, PC+mobile independent mode) and other key information. The system identifies and enables the template through this file.

It should be particularly pointed out that the static resources referenced in the template file, such as the website's CSS stylesheets, JavaScript scripts, and various image files, are not stored directly in/templateThe directory and its subdirectories. These static resources are managed independently, and are stored uniformly in the root directory of the website./public/static/The directory. This design pattern helps optimize the loading efficiency of static resources, facilitates the use of CDN for accelerated distribution, while maintaining the purity of the template directory and focusing on structural logic.Therefore, when writing template files, it is necessary to ensure that the path points to these static resources/public/static/The correct position in the directory.

In addition, Anqi CMS also provides comprehensive support for mobile template. If your website needs to provide exclusive layouts and styles for mobile devices, the system allows you to create subdirectories within each template set.mobileFolder. For example, if your PC template is located in/template/default, then the corresponding mobile template file will be stored in/template/default/mobileUnder the path. When the website is set to "code adaptation" or "PC + mobile independent site" mode, the system will intelligently load the corresponding template according to the type of the accessing device, ensuring that users can have a high-quality browsing experience on any device.The internal file structure of the mobile template is consistent with that of the PC template, facilitating synchronized maintenance and updates for developers.

In summary, the template file storage rules of AnQi CMS are clear and rigorous, the core lies in/templatethe directory, which is internally through subfolders andconfig.jsonThe file implements isolation and management of multiple templates, while static resources have independent/public/static/The catalog. Properly understanding and following these rules is a key step in successfully operating and maintaining the AnQi CMS website.


Frequently Asked Questions (FAQ)

Q1: Why must the template files of AnQi CMS be stored in/templateUnder the directory? Can I customize the path?A: In the design architecture of Anqi CMS,/templateThe directory is the system hard-coded root path for template loading. This is the core mechanism by which the system identifies, compiles, and renders all front-end templates.The current version does not allow customizing the storage path of template files. If changed, the system will not be able to find and correctly render your website template, resulting in the website not being able to access normally.

Q2: Where should I place the images, CSS, and JavaScript files I use in the template? Are they in the same directory as the template file?A: Static resource files such as images, CSS, and JavaScript used in the template should not be placed directly in/templateThe directory or its subdirectory. Anqi CMS provides an independent storage location for static resources, unified under the root directory of the website./public/static/In the folder. This separation helps optimize website performance, manage and utilize CDN services. When referencing these resources in template files, make sure to use the correct/public/static/relative path.

Q3: How should I organize files for an independent template designed for mobile devices?A: For scenarios requiring independent mobile templates, you should create a folder namedmobilein the corresponding PC template subdirectory. For example, if your PC template is in/template/mythemeSo the mobile template file should be stored in/template/mytheme/mobile. The system will automatically recognize and load in the "code adaptation" or "PC + mobile independent site" modemobileThe template under the directory, ensuring a good browsing experience for mobile device users.

Related articles

What suffix should be used for AnQiCMS template files?

As a senior CMS website operator, I am well aware that the correct use and management of template files are crucial for the stable operation and content presentation of the website.A clear template structure not only facilitates content creation and publishing, but also ensures the maintenance efficiency and scalability of the website.What suffix should be used for the Anqi CMS template file, this is a fundamental and key question, we can find the clear answer from the system design conventions.

2025-11-06

Which function upgrades in the AnQiCMS update log have the greatest impact on website operation?

As a senior security CMS website operator, I fully understand the importance of each system update to daily work efficiency and the overall performance of the website.AnQi CMS is committed to providing efficient solutions for small and medium-sized enterprises and content operation teams, and the functional upgrades in its update log often directly relate to all aspects of our content creation, publication, optimization, and even user maintenance.The detailed explanation of which function upgrades in the AnQiCMS update log have the greatest impact on website operation.

2025-11-06

What are the basic conventions and recommended directory structures for AnQiCMS template creation?

As an experienced CMS website operations personnel for a leading security company, I know that a set of efficient and standardized template systems are crucial for the long-term development of the website and the efficiency of content management.AnQi CMS relies on its simple and efficient architecture and Django-style template engine, providing great convenience for content creators and operators.During the template creation process, adhering to certain basic conventions and recommended directory structures can effectively improve development efficiency, reduce maintenance costs, and ensure the flexible display of website content.

2025-11-06

How to efficiently publish and manage content on AnQiCMS's document management interface?

As a website operator who deeply understands the operation of AnQiCMS, I know that efficient content publishing and management is the foundation of website success.AnQiCMS with its powerful feature set and flexible design provides us with an excellent content operation experience.I will elaborate in detail on how to efficiently publish and manage content in the document management interface of AnQiCMS.

2025-11-06

Where should the static resources such as images, JS, and CSS used in the template be stored统一放在哪里?

Hello!As an experienced security CMS operator, I fully understand the importance of static resource management in website construction and content management.High-quality static resource management not only improves website performance, but also optimizes maintenance efficiency.According to the Anqi CMS documentation and our practical experience, here is a detailed explanation of where the static resources such as images, JS, and CSS used in the template should be stored.

2025-11-06

How to distinguish between variable output (`{{ }}`) and logical control tags (`{% %}`) in AnQi CMS template?

As an experienced AnQiCMS website operator, I am well aware of the core role of templates in content presentation and user experience.Mastering AnQiCMS template syntax, especially distinguishing between variable output and logical control tags, is the key to refined operation and achieving personalized content display. ### Data Display and Logic Control in AnQiCMS Template The design of AnQiCMS template aims to provide strong flexibility, allowing content to be displayed in a diverse manner according to business needs. In the template file, we mainly encounter two types of special markers: double curly braces `{{

2025-11-06

Are conditional judgment and loop control tags in the template required to have closing tags?

As an experienced CMS website operation person, I am well aware of the importance of template design for website content display and user experience.During the process of content creation, editing, and publishing, we often deal with templates, and understanding the correct usage of template tags, especially the closure requirements of conditional judgment and loop control tags, is the basis for ensuring the correct rendering of content and the stable operation of the website.About whether the end tags are required for conditional judgment and loop control tags in the template, the template engine of AnQi CMS follows clear conventions.Make the agreement document according to the template we provide, **condition judgment

2025-11-06

What is the naming rule for template variables?(For example:`archive.Id`)

As a senior security CMS website operator, I know that a clear and consistent template variable naming rule is crucial for the efficient operation and content management of the website.This not only improves the efficiency of template development and maintenance, but also helps operation personnel quickly locate and understand the data structure when adjusting content.In Anqi CMS, the naming of template variables follows a set of clear conventions aimed at ensuring the readability and maintainability of the system.

2025-11-06