In website operation, we often encounter such needs: some single pages, such as "About UsAnQi CMS understands the importance of personalized display and therefore provides a very flexible way, allowing us to tailor a unique template for each single page, achieving a highly personalized display effect.

The AnQi CMS uses a template engine syntax similar to Django, making template creation very intuitive. All template files are stored in the root directory./templatefolder, with the.htmlas a suffix. For single-page, the system defaults to trying to usepage/detail.htmlAs a general template.But if we need more fine-grained control, Anqi CMS allows us to specify a completely independent template file for a single page.This independence means that you can design a warm corporate story layout for the "About Us" page, integrate an interactive map and form for the "Contact Us" page, and these will not affect the display of other pages.

Next, we will learn in detail how to set up an independent template for the single-page of Anqi CMS.

Step 1: Plan and design your exclusive page

Before you start creating the template file, it is very helpful to spend some time thinking about the unique aspects of this single page.It needs to display what content?What are some special interactive or visual elements?For example, a product detail page may require a carousel, a detailed parameter table, and a download button, while a service introduction page may focus more on a visually comprehensive process display.Clear planning can make the subsequent template creation twice as effective, ensuring that the final page is both beautiful and practical.

Step 2: Create your exclusive template file

After the planning is completed, we can start creating template files. This file needs to be placed in your current theme template directory. Assuming your website is using a theme nameddefaultThe subject, and you want to create an independent template for the "About Us" page. You can create a namedtemplate/default/page/directory, create a namedabout.html.

with such a naming style (page/你的自定义名称.html)It is clear and logical, making it easy for you to identify and manage. Of course, you can also use other filenames that you think are appropriate and meaningful, as long as they end with.htmland stored inpage/This subdirectory is where it is. This file will carry all the HTML structure and styles you customize for the single page.

Step 3: Specify the template in the Anqi CMS backend.

After the template file is ready, we need to tell the Anqi CMS which single page should use the new template you just created. This process is very simple:

  1. Log in to the Anqi CMS backendNavigate to the left menu'sPage Resources.
  2. ClickPage ManagementYou will see all the single page lists of the current website.
  3. Find the single page you want to personalize (if you haven't, you can click "Add New Page" to create one), then click the page'sEditbutton.
  4. After entering the page editing interface, scroll down and you will see a name calledSingle page templatefield.
  5. In this field, you need to enter the path of the template file you just created relative to the theme template directory. Continue with the "About Us" page as an example, if the template file you created istemplate/default/page/about.htmlFill in the field herepage/about.htmlThe system will search for the corresponding template in your theme folder according to the path you enter.
  6. Click the bottom of the page after filling outSaveButton. In this way, your "About Us" page will usepage/about.htmlthis template to render.

Step 4: Fill in the template content and data call

Now, your exclusive template has been linked to the corresponding single page. You canpage/about.htmlIn the file, use the powerful template tags of AnQi CMS to call page content and make it dynamic. For example, using{% pageDetail with name="Title" %}You can obtain the title you set for the single page in the background,{% pageDetail with name="Content" %}It will render the main content you fill in the backend editor.

In addition, you can also combine withsystemtags to call the global settings of the website (such as website name, Logo), or usecontactLabel to get contact information. The AnQi CMS template engine supports conditional judgment ({% if ... %}), loop ({% for ... %}This syntax means that you can build complex layouts and logic, such as displaying multiple Banner images ({% pageDetail pageImages with name="Images" %}Or according to specific conditions, different information is displayed. Make full use of these tags, and your personalized single-page will be able to present rich content and unique interactions as expected.

Summary

By following these simple and clear steps, we have successfully set up an independent template for the single page of AnQi CMS, achieving a highly personalized display. This flexible template mechanism not only makes the form of your website content more diverse, but also greatly improves the user experience, helping to shape the brand image and specific marketing.