As a senior security CMS website operations personnel, I know that the flexibility of content display is crucial for attracting and retaining users.The Auto CMS provides powerful template customization capabilities, allowing us to specify independent template files for different pages based on their characteristics, thereby achieving personalized content layout and design.This is particularly important for creating unique single-page experiences, such as 'About Us', 'Contact Information', or specific event landing pages.

Understanding the template mechanism of the AnQi CMS

All template files in Auto CMS are stored uniformly in/templateThe contents are organized in folders under the theme folder.Each topic can be organized in a folder pattern or a flat file pattern.page/detail.htmlThis means that when we create a single-page without specifying a specific template, the system will apply it automaticallypage/detail.htmlTo render its content. However, to meet more advanced customization requirements, Anqi CMS allows us to specify a completely independent template file for any single page.

Why do we need an independent single-page template

In actual operation, many scenarios require a single page to have a unique design that is different from the general layout. For example:

  • About Us pageIt may be necessary to display rich content such as team member introductions, timeline of development history, and need specific layouts to enhance brand image.
  • “Contact Us” pageIn addition to basic contact information, it may also be necessary to integrate maps, online forms, or multi-channel customer service portals, which requires a customized template to present efficiently.
  • Marketing campaign landing pageVisual design and content layout often require high customization to maximize conversion rates. An independent template ensures that these pages are not limited by the universal layout.
  • Download Center or Information Display PageMay require specific file lists, search, or filter functions; independent templates can provide a more professional interactive experience.

By specifying independent templates for these single-page applications, we can break free from the constraints of the general layout, allowing for more freedom in designing page structure, style, and functionality, thereby better serving content goals and user experience.

Create your custom single-page template file

To specify an independent template file for a single page, you first need to create this file.

You need to create a dedicated directory for storing custom single-page templates within the current theme directory, for example,/template/您的主题名称/page/Of course, you can also place the template file directly under the theme root directory, but for better file organization and easy management, it is recommended to create one inpage/the directory.

The naming of template files should be descriptive and easily recognizable, and it must use.htmlAs a file extension. For example, if you want to create a dedicated template for the "About Us" page, you can name itabout-us.html. If you have a special download page, you can name itdownload-page.html.

In this newly created.htmlIn the file, you can write the unique HTML structure and content of this single-page.You can fully utilize the various tags and filters provided by the Anqi CMS template engine, introduce common components such as headers and footers, and define content layout and styles according to the specific needs of the page.

In the Aanqi CMS background application custom template

Create a custom template file first, and then the next step is to apply it to a specific single page in the backend management interface of the Anqi CMS.

Please log in to your security CMS backend, navigate toPage Resourcespart, then clickPage Management. Here, you can choose to edit an existing single page or create a new single page.

In the editing or creation interface of a single page, scroll down to findSingle Page Templatethis setting item. This field allows you to enter the name of the template file used to render the current single page.

Here, you need to enter the name of the custom template file you just created. For example, if your template file is located/template/您的主题名称/page/about-us.html, then you just need to fill in the input box.page/about-us.htmlIf you place the template file directly in the theme root directory, for example/template/您的主题名称/download.html,then enterdownload.html.

填写完毕后,请务必保存单页面的所有更改。保存成功后,当用户访问这个单页面时,系统将不再使用默认的Englishpage/detail.html,而是加载并渲染您指定的Englishpage/about-us.html(Or other custom template)to display page content.

Key Points to Note

  • Existence of template file:Ensure that the template file name you fill in the background is accurate, and that the file indeed exists in the specified path of your current theme.If the file does not exist or the path is incorrect, accessing this single page may cause errors or display a blank page.
  • Relative path:The path and filename filled in the "Single Page Template" field should be relative to the root directory of the current theme.
  • Template syntax:Custom template files should follow the Django template engine syntax supported by AnQi CMS to ensure that content and logic can be correctly parsed.
  • Test verification:After completing the settings, be sure to visit this single page, check if the custom template has been successfully applied, and whether the page content, layout, and functionality are all displayed and working as expected.

By following these steps, you can flexibly specify independent template files for each single page in the AnQi CMS, thus achieving richer and more attractive website content display.

Frequently Asked Questions

Q1: What happens if the specified custom template file does not exist?A1: If the custom template file for a single-page specified in the background does not exist or the path is incorrect, the system will not be able to find the corresponding template file to render when the user accesses the single-page.This usually causes the page to display errors, blank pages, or system errors.Therefore, after setting a custom template, be sure to check that the template file exists and that the path is accurate.

Q2: Can I use the template tags and filters of the AnQi CMS like other templates in the custom single-page template?A2: Of course. Custom single-page templates are just like other template files in Safe CMS, fully supporting the use of various built-in template tags (such assystem/archiveList/pageDetail) and filters (such assafe/truncatechars/stampToDateThis allows you to flexibly call system data and control content format in custom templates, realizing rich functions and interactions.

Q3: Will specifying an independent template for a single page affect other single pages on my website?A3: EnglishSpecify an independent template file for a single page, which has a local effect, only affecting the specific single page you set.page/detail.htmlTemplates, or using the specific templates set in their respective backend settings, do not affect each other.