How to set and display a custom template on a single page of AnQi CMS?

Calendar 👁️ 61

AnQi CMS with its powerful flexibility and ease of use has become a helpful assistant for many content operators.Especially in terms of content display, it provides us with rich customization space.For web pages that require unique layouts or specific functions, such as "About Us", "Contact Us", or a special event landing page, we often hope that they can have a completely different visual style from ordinary articles or list pages.A safe CMS provides a very convenient way, allowing us to set exclusive custom templates for these single-page websites, so that every corner of the website can meet our personalized needs.Today, let's take a detailed look at how to implement custom template settings and display on a single page in Anqi CMS.

1. Understand the single page and template mechanism of Anqi CMS

Firstly, we need to have a clear understanding of the 'single page' in Anqi CMS.As the name implies, a single-page refers to pages that are independent, not dependent on categories or specific content models, and are usually presented as a single piece of content.They are commonly used to display company profiles, service introductions, privacy policies, or as specific marketing activity pages.In Anqi CMS, these pages are created and edited through the "Page Resources" module under "Page Management."}

The template mechanism follows. Anqi CMS adopts a template engine syntax similar to Django, making our template creation and maintenance very intuitive. All template files are written with.htmlWith suffix, and stored uniformly in the root directory of the site/templatein the folder. To facilitate management, each template theme will have its own independent directory, such asdefault.

For a single-page, the system itself provides some default template rules. For example,page/detail.htmlIt is usually a general single-page detail template. Further, you can also create a single-page for a specific ID.page/detail-{单页ID}.htmlThis is a template. But the strength of Anqi CMS lies in its ability to allow us to define template filenames more freely.This means you are not limited to system-generated IDs, you can completely use page aliases or any meaningful names, such aspage/about-us.htmlCreate a dedicated template to achieve highly personalized display.

Second, set a custom template for a single page in the background.

The process of setting a custom template for a single page is very direct, mainly completed in the Anqi CMS backend management interface.

  1. Enter Page Management:Log in to the Anqi CMS backend, find the "Page Resources" module under the left-hand navigation bar.Here, you can choose to create a new single page or edit an existing one.
  2. Locate the field “Single Page Template”:After entering the single-page editing interface, you will see a series of fields for filling in page information, one of which is an option called "Single Page Template".This field is the key to specifying the custom template file.
  3. Enter a custom template filename:In the 'Single Page Template' field, you need to enter the name of the template file you have prepared for this single page. For example, if you want to design a very special layout for the 'About Us' page, you can prepare a file named in the template directory.about-us.htmlThe file, so here you just fill inabout-us.html. The system will search for and apply the corresponding template in the template theme folder you are currently using according to the filename you enter.

It should be emphasized here that the filename you enter must be exactly the same as the template file name you create on the front-end, including the suffix (.html) and case. If the system cannot find the corresponding template file, the single page may display an error (such as a blank page) or revert to a default display method, which will affect the user experience.

Build the front-end custom template file

The template file name has been set up on the backend, and the next step is to create and write the custom template file.

  1. Determine the location of the template file:First, you need to enter the root directory of your Anqicms website, find/templatefolder, then enter the theme directory you are currently using (for exampledefault)。To maintain good file organization and management, it is usually recommended to store the custom template files for a single page in the theme directory.page/In the subdirectory. Therefore, according to the settings of the background, you may need to create something similar/template/default/page/about-us.htmlsuch a file.
  2. Write the template content:Open the one you created.htmlFile, you can start writing your page layout and content. The Anqi CMS template engine supports rich syntax, allowing you

Related articles

How to display the child category list of a specified category in Anqi CMS

The way website content is organized is crucial for user experience and information retrieval efficiency.A clear classification structure not only helps visitors quickly find the information they need, but also effectively enhances the professionalism and user retention rate of the website.In AnQiCMS (AnQiCMS), the flexible template tag system makes it very convenient to display the subcategory list of a specified category.### Core Tool: The Use of `categoryList` Tag To display the child category list of a specified category in Anqi CMS, we mainly use the `categoryList` tag

2025-11-08

How does Anqi CMS implement the scheduled release of website content, so that it automatically displays at a specified time?

In content operations, efficiency and strategic thinking are the key to success.AnQiCMS (AnQiCMS) is well-versed in this field and offers a practical feature - scheduled content publishing, allowing website managers to accurately schedule the content release time, thus achieving automated operation and effectively enhancing the spread of content and website activity. ### Scheduling Posting: The Automation Tool for Content Operations Imagine that your website needs to publish industry news at a fixed time every morning, or plan a series of promotional articles in advance for specific holidays or marketing events. If relying on manual release by humans

2025-11-08

How to display the website logo and filing information in the AnQi CMS front-end template?

In website operation, Logo and filing information are not only the core of brand recognition, but also an important link for establishing user trust and complying with regulations.AnQi CMS took these key elements into consideration from the very beginning, providing intuitive settings and flexible template calling methods, allowing website operators to easily display this information on the front end.### Understanding AnqiCMS template mechanism Before delving into how to display the logo and filing information, it is very helpful to briefly understand the AnqiCMS frontend template mechanism.

2025-11-08

How can AnQi CMS ensure website content security, prevent malicious scraping, and protect the display of picture copyrights?

In the era of the explosion of digital content, the security of website content, the prevention of malicious collection, and the protection of image copyrights have become core challenges that website operators cannot ignore.A stable and reliable content management system should be able to provide a set of effective solutions.AnQiCMS (AnQiCMS) as an enterprise-level content management system provides multi-dimensional functional support in this aspect, helping users effectively protect their digital assets.Firstly, in terms of the overall security of the website content, Anqi CMS provides a solid foundation of protection.It is developed based on Go language

2025-11-08

How to retrieve and display the document list under a specified Tag in AnQi CMS?

AnQiCMS (AnQiCMS) offers great convenience to website operators with its flexible content management and powerful template engine.In daily content operation, we often need to aggregate and display lists of related documents based on specific tags (Tag), such as 'Hot Topics', 'Technical Tips', or 'Product Reviews' and so on.This not only helps users quickly find the content they are interested in, but also effectively improves the internal link structure of the website, which is very beneficial for SEO.This article will delve into how to retrieve and display a list of documents under a specified tag in AnQiCMS

2025-11-08

How to display and manage the website message form of AnQi CMS and customize fields?

The website message form is an important link between users and the website, it not only helps us collect valuable opinions and suggestions, but also lays the foundation for various interactive functions such as user consultation and service reservation.AnQi CMS is well-versed in this, providing website operators with a straightforward, efficient, and highly customizable feedback form solution, making it exceptionally simple to manage and customize form fields.### Easily build the frontend presentation of the message form In Anqi CMS, to display the message form on the website page, you do not need to write complex backend logic, just insert the specific tags in the template file

2025-11-08

How to add and display friendship links on the Anqi CMS website?

In website operation, friendship links play an indispensable role.They not only help to improve the search engine ranking (SEO) of a website, but also bring potential traffic and improve the user experience, allowing visitors to get more information through related websites.AnQiCMS (AnQiCMS) understands this and therefore provides an intuitive and convenient friend link management feature, allowing you to easily add, manage, and display these important external connections.This article will introduce in detail how to add friend links in the Anqi CMS background, as well as how to flexibly display them on the website's front-end template

2025-11-08

How does the comment function of AnQi CMS display comment lists and reply levels?

AnQiCMS (AnQiCMS) as an efficient and flexible content management system, provides rich content display capabilities while also offering a comprehensive comment function for user interaction.Understand how to effectively display a comment list, especially in handling multi-level replies, which is crucial for enhancing the user engagement and content depth of a website. ### AnQiCMS Comment Function Implementation Basics Commenting functionality is an important part of website content interaction in AnQiCMS.The system is not only built-in with support for comments on articles, products, and other content

2025-11-08