How to customize a template to achieve personalized display of single-page content (such as "About Us")?

Calendar 👁️ 77

In website operation, personalized display is crucial for shaping brand image and improving user experience.Especially single pages such as "About Us" and "Contact Information" that carry the core information of a company, through customized design, can better convey the brand story and enhance user trust.AnQiCMS (AnQiCMS) provides a flexible way to achieve this goal, even for users with little technical background.

Understand the single-page content mechanism of Anqi CMS

In Anqi CMS, single-page content (such as "About Us", "Service Introduction", etc.) is unifiedly maintained in the background under "Page Resources" -> "Page Management". The system provides a default display template for single pages, usually located in the current theme directory.page/detail.htmlThis means that if you do not make any special settings, all single pages will adopt this unified layout.

However, when you want a specific single page to have a unique appearance or functionality, such as designing a more narrative layout for the "About Us" page or integrating specific interactive elements for the "Contact" page, the custom template feature of Anqi CMS can come in handy.

The core steps to implement a single-page personalized display

The AnQi CMS allows you to specify a completely independent template file for a single page, thereby breaking the default unified layout.This process is mainly divided into two core steps: creating a custom template file, and associating the file with specific single-page content in the background.

Step 1: Create a custom template file

First, you need to create a custom template file in the directory of the template theme you are currently using. Anqicms has clear conventions for the organization of template files:

  1. Template storage path:Your custom single page template file should be placed in the current theme directory.page/In the folder. For example, if your template theme directory istemplate/default/, then your custom file should be placed intemplate/default/page/below.

  2. Template naming:You can name it according to the page ID, for examplepage/detail-10.html(If the ID of the "About Us" page is 10), but it is more recommended to use a meaningful custom name. For example, you can create a name for the "About Us" page namedabout-us.htmlThe template file, then its full path will betemplate/default/page/about-us.htmlThis method is more intuitive, convenient for management and identification.

  3. Template content:In this new one.htmlIn the file, you can freely write the HTML structure of the page and combine it with the template tags provided by Anqi CMS to dynamically obtain the page content. Anqi CMS uses a syntax similar to the Django template engine, and variables are enclosed in double curly braces{{变量}}Logical judgments and loops use single curly braces and percent signs{% 标签 %}.

Step two: Associate the custom template in the background

After creating the template file, the next step is to associate it with the specific single-page content:

  1. Enter Page Management:Log in to the AnQi CMS backend, navigate to "Page Resources" -> "Page Management".
  2. Edit the target page: Find the single page you want to customize (for example, "About Us"), click edit to enter the page editing interface.
  3. Specify a custom template:In the 'Other Parameters' section of the page editing interface, you will find a field named 'Single Page Template'.Enter the relative path and filename of the custom template file you just created.For example, if you create a file that istemplate/default/page/about-us.html, then you just need to fill in this field.page/about-us.htmlJust do it.
  4. Save and preview:After filling in, save the page and refresh the front desk of the website to view the effect.

Build personalized single-page content (code example)

The custom template file is where you can unleash your creativity. Here, you can use the powerful template tags of Anqi CMS to organize page content.This is a simplified example of how topage/about-us.htmlRetrieve the title, content, images, and contact information of the "About Us" page from the template:

`twig {# Assume there is a basic layout template, such as base.html, for a unified header, footer, etc. #} {% extends 'base.html' %}

{# Set page title, keywords and description, which are usually obtained from the TDK settings of the current single page #} {% block title %}{% pageDetail with name=“Title” %} - {% system with name=“SiteName” %}{% endblock %} {% block keywords %}{% endblock %} {% block description %}{% endblock %}

{% block content %}

{# 获取当前单页面的标题 #}
<h1 class="text-center mb-4">{% pageDetail with name="Title" %}</h1>

{# 获取单页面设置的Banner图或幻灯片组图,如果有多张图,这里取第一张作为Banner #}
{% pageDetail pageImages with name="Images" %}
{% if pageImages %}
<div class="page-banner text-center mb-5">
    <img src="{{ pageImages[0] }}" alt="{% pageDetail with name="Title" %} Banner" class="img-fluid rounded shadow-sm">
</div>
{% endif %}

<div class="row">
    <div class="col-md-8 mx-auto">
        {# 获取单页面的主要内容,并使用 |safe 过滤器确保

Related articles

How to retrieve and display detailed information of a specified category (such as title, description, Banner image)?

In website operation, we often need to create unique and attractive display pages for specific categories, or flexibly call some detailed information of certain categories at different locations.For example, you may wish to display a dedicated Banner image at the top of a product category page, or list the title and introduction of a specific service category in the sidebar.AnQiCMS as an efficient and customizable content management system provides a very intuitive way to meet these needs.To obtain and display detailed information about a specified category, such as the title, description, and Banner image

2025-11-09

How the generation and processing method of thumbnails (such as cropping, padding) affects the front-end image display?

Optimize website image display: In-depth analysis of Anqi CMS thumbnail processing method In content management, images are an indispensable element to attract users and convey information.Whether a website image is clear, beautiful, and loads quickly directly affects the user experience and the overall professionalism of the page.And the thumbnail as the first impression of the image display, its generation and processing method is particularly important.AnQiCMS (AnQiCMS) provides a flexible thumbnail generation and processing mechanism for image management, allowing us to finely control the display effect of front-end images according to the needs of different scenarios.### Thumbnail

2025-11-09

How does AnQiCMS handle images in document content (such as remote image download, Webp format conversion)?

## Mastering the Whole Picture: How AnQi CMS intelligently handles document content images, enhancing website loading speed and user experience In today's content-king digital age, the expressiveness, loading speed, and search engine friendliness of website images are crucial for user experience and SEO.A high-efficiency content management system should provide powerful and convenient functions in image processing.AnQiCMS (AnQiCMS) is well-versed in this field, helping users easily optimize website images through a series of intelligent image processing mechanisms. No matter where the images come from or in what format they exist, they will be properly handled

2025-11-09

How to precisely control the display of document title, introduction, content, and other elements on the article detail page?

The article detail page is the core display area of the website content, which directly affects the user's access experience and the perception of the website's professionalism.For AnQiCMS users, mastering how to finely control the display of various elements on the article detail page can not only enhance the visual appeal of the website but also optimize the user's reading path, effectively improving SEO performance.AnQiCMS as a flexible content management system provides various ways to help us accurately adjust the title, abstract, content, and other additional information presentation of the article detail page

2025-11-09

How to safely and effectively display user comment lists and message forms in a template?

In modern website operations, user-generated content (UGC) is an important component for enhancing website activity and user stickiness.User comments and online message functions not only promote community interaction and provide valuable feedback, but also help enhance the richness of content and the activity of search engines.AnQiCMS as a content management system focusing on efficiency, security, and customization, provides us with powerful and flexible support to display these features safely and effectively in templates.Ensure that the comment list and message form are presented beautifully while兼顾 safety and functionality

2025-11-09

How to use友情链接 tags to display partner websites at the bottom of the website or other areas?

In website operation, the friendship link of cooperative websites is not only an important part of search engine optimization, but also an effective way to expand brand influence and promote mutual traffic redirection.Display these important cooperative partnerships prominently on the website, such as at the bottom or sidebar, which can effectively enhance user trust and the authority of the website.AnQiCMS (AnQiCMS) provides a convenient friend link management function and flexible tag calling method, allowing you to easily achieve this goal.### Overview of the friendship link backend management Before using the `linkList` tag

2025-11-09

How to configure pagination tags to provide user-friendly content list navigation?

In Anqi CMS, as the content on our website becomes richer and richer, how to efficiently organize and present this information so that visitors can easily find what they need among the vast amount of content has become a key issue.Excellent content list navigation, especially the pagination feature, not only enhances user experience, but is also an indispensable part of search engine optimization (SEO).The AnQi CMS provides powerful and flexible pagination tags, allowing you to easily configure user-friendly content list navigation.### The Foundation of Content List: Configure Content Retrieval Tag In Anqi CMS, all content lists, whether articles

2025-11-09

How to use if and for tags in templates to implement conditional judgment and loop display of data?

When building a website with AnQiCMS, the template is the key to content display.By flexibly using template tags, we can present the content of the back-end management in various forms to the users.Among them, `if` and `for` tags serve as the core of template logic control, helping us to implement conditional judgments and the cyclic display of data, making the website content more dynamic and rich.AnQiCMS's template engine borrows the syntax style of Django, which makes learning and using these tags very intuitive.It allows us to write logic directly in the template

2025-11-09