In the daily operation of AnQiCMS, we often need to customize the website pages to meet specific design or functional requirements.Single-page sections, such as 'About Us' and 'Contact Us', often carry unique brand information for a company. Therefore, configuring custom templates for them is a common need for website operators.Where should these single-page template files that carry creativity and customization be stored in the Anqi CMS directory?Today, let's delve deeply into this issue.

The place of belonging for the AnQiCMS single-page custom template files

Firstly, we need to clarify the "home" of all template files in the security CMS: they are uniformly stored in the root directory of the project./templatefolder./templateThe catalog, which is the collection of all template themes.After you select and enable a template theme, the Anqi CMS will look for the required template files in the corresponding subdirectory of that theme./template/default/directory is where they are searched for and used.

For a single-page application, Safe CMS has a conventionally agreed directory structure. Within any template theme, the single-page template files are usually placed in a directory namedpage/in the subdirectory. This means that if you are currently using the "default" theme, the default path for the single page template will be/template/default/page/.

in thispage/Under the directory, Aiqi CMS will recognize some default template files. For example, a general single-page detail template might bedetail.html, while for a single-page with a specific ID, it might usepage-{单页ID}.htmlsuch naming format.

However, the strength of AnQi CMS lies in its high flexibility and customizability. If you want to design a completely unique template for a specific single page (such as "About Us") without using a genericdetail.htmlHow about a default template based on ID? The answer is: you can fully customize it!

You can find the currently enabled template theme directory underpage/In the subdirectory, create a brand new HTML file and give it a descriptive name, such asabout.html. Therefore, its full path might be/template/default/page/about.html.

After you have completed the creation of the template file, what you need to do is go to the editing interface of this single page on the Anqi CMS backend.In the page settings options, there is usually a field called 'Single Page Template'.about.htmlAfter saving the settings, this "About Us" page will use the meticulously designedabout.htmltemplate for rendering.

This design concept not only makes the management structure of template files clear, but also greatly enhances the freedom of content operations. Whether adopting a folder organization mode or a flat file organization mode, the core principle is to concentrate the related template files of a single page.page/Under the directory, and simple configuration on the back end can be used to achieve the flexible application of templates.

Summary of key points:

  • The template root directory of Anqi CMS is:/template.
  • Each independent template theme will be in/templateContains its own folder (such as/template/default/).
  • Single-page template files should be stored in the directory of the currently enabled themepage/subdirectory.
  • You can create any named HTML file (such asabout.html) inpage/As a custom template under the directory.
  • In the background single page editing interface, specify the filename through the 'Single Page Template' field, and the custom template can be applied to a specific single page.

In this way, even those without a strong technical background can easily achieve personalized layout and content presentation for websites, making each single page exude a unique brand charm.


Common Questions (FAQ)

Q1: What problems will the website have if I place the custom single-page template file in the wrong directory? A1:If you place the custom template file in the wrong directory, or if the template file name filled in the background does not match the actual path, the Anqi CMS will not be able to find and load the template.This usually results in page display errors, such as returning a 404 error, a blank page, or reverting to the use of the system default universal single page template (if it exists and is configured correctly)./template/你的主题目录/page/Below, and the name specified by the background is accurate and correct.

Q2: Can I/page/Do you want to create subdirectories under the folder to further organize my custom single-page templates? For example/page/company/about.html? A2:According to the design conventions of Anqi CMS, the background should fill in the "Single Page Template" field with a relative path topage/the filename of the directory. The custom cases mentioned in the document arepage/about.htmldirectly inpage/Create a file in the directory. Although theoretically some template engines may support deeper paths, it is recommended to directly place the custom template files in order to ensure compatibility and avoid unnecessary trouble.page/Ensure the uniqueness of file names within the directory. If a more complex organizational structure is indeed necessary, it is recommended to conduct a small-scale test first to confirm that the system can correctly identify.

Q3: What are the naming restrictions for the file name of a custom single-page template? A3:It is recommended to follow the standard file naming conventions, using English letters, numbers, underscores, or hyphens, and ending with.htmlas a file extension.Avoid using Chinese characters, special symbols, or spaces to prevent compatibility issues in different operating systems or server environments.contact-us.html/service-intro.html)It is not only convenient to manage, but also more in line with the**practice** of development and operation.