How to set up an independent template for the single page of AnQi CMS to achieve highly personalized display?

Calendar 👁️ 71

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.

Related articles

How to customize the content model field and flexibly call it to display its content in the template?

AnQiCMS is one of the core strengths in content management, with its flexible and customizable content model.This allows us to no longer be limited by a fixed content structure, enabling us to create personalized content types that meet the actual operational needs of the website.No matter if you are publishing technical articles, showcasing product details, or managing event information, custom content model fields can help you accurately construct the content structure you need and ultimately flexibly display it on the website front end.

2025-11-08

How to use the recommendation attribute (Flag) of AnQi CMS to display featured content on the homepage or special page?

AnQi CMS provides an efficient way to manage and highlight important content on your website, that is, through the "recommended attribute" (Flag).This feature allows you to easily display carefully selected content on the homepage, special pages, or other key positions, thereby guiding visitors' attention and enhancing the interactivity and information transmission efficiency of the website. ### Recommended Attribute Settings: The First Step of Content Selection In the AnQi CMS backend, the starting point of content management is to publish or edit documents.When you are ready with high-quality content, you hope it will stand out at a key position on the website

2025-11-08

How does Anqi CMS implement seamless language switching and display of multilingual content on the front-end page?

Today, with the deepening of globalization, website content that can reach users of different languages has become a key factor in enterprises expanding the market and enhancing brand influence.AnQiCMS (AnQiCMS) is well aware of this need, and from the very beginning of system design, it has made multilingual support one of its core features, aiming to help users easily switch and display content seamlessly on the front-end page.How does Anqi CMS help us build and manage multilingual websites and allow visitors to switch between different language versions smoothly?

2025-11-08

How to accurately retrieve and display a specific article list based on category ID?

In a content management system, effectively organizing and displaying content is crucial for improving user experience and website SEO performance.AnQi CMS with its flexible and powerful template engine allows you to easily implement the requirement of fetching and displaying a list of articles based on a specific category ID.Whether it is to build a special page, category archive, or simply to display the latest content of a specific column on the homepage, Anqi CMS can provide intuitive and efficient solutions.This article will deeply explore how to utilize the template tag feature of Anqi CMS, especially the `archiveList` tag, to accurately achieve this goal

2025-11-08

How to control the automatic lazy loading of images in the article content of AnQi CMS

In website operation, page loading speed and user experience are crucial aspects.Especially for articles that contain a large number of images, the loading of images often becomes the 'culprit' that slows down the page speed.At this time, the image lazy loading (Lazy Loading) technology is particularly critical.AnQi CMS deeply understands this, providing a simple and efficient way to control the automatic lazy loading of images in article content, helping your website to improve performance and user experience.Why is lazy loading of images so important? Lazy loading of images is a strategy of deferred loading

2025-11-08

How to display website name and Logo in AnQiCMS?

The website's name and logo are like the face of a brand, they are not only the first impression visitors have of you, but also an important manifestation of the website's professionalism and recognition.In AnQi CMS, setting and displaying your website name and logo is a straightforward and efficient process.Next, we will explore how to perfectly present these key elements on your website. ### First, set up the website name and Logo To make your website have a unique name and Logo, the first step is to configure it in the Anqi CMS backend management interface.1. **Enter Global Settings**

2025-11-08

How to obtain and display the filing number of the AnQiCMS website?

For websites operating in mainland China, the filing number (ICP number) is an indispensable element.It is not only a requirement of laws and regulations, but also an important symbol to enhance the credibility of the website and gain the trust of users.AnQiCMS knows this point and therefore considered convenient management and display of the filing number at the very beginning of system design, allowing website operators to easily complete the configuration. Next, we will together learn how to obtain (configure) and display the filing number on the AnQiCMS website.

2025-11-08

How to display custom copyright information in AnQiCMS templates?

In AnQiCMS website operation, the website footer usually carries important information, among which the copyright statement is not only a legal requirement, but also an embodiment of brand professionalism.Clear and dynamically updated copyright information that can enhance the professional image of the website and provide basic protection for the content.In AnQiCMS, managing and displaying custom copyright information on the website is a very intuitive and flexible operation.Next, we will learn how to set and display your custom copyright information in the AnQiCMS template.--- ### One

2025-11-08