How to set up independent display templates for AnQiCMS documents or categories?

Calendar 👁️ 72

In website operation, we often encounter such needs: some documents need a unique display method, the article list under a certain category needs a special layout, or a single page needs a unique design.AnQiCMS understands the importance of this personalized need and provides flexible template settings, allowing you to easily set independent display templates for documents, categories, and even single pages.This not only helps you better meet the diversity of content display, but also greatly enhances the user experience and the brand image of the website.

Why do you need an independent display template?

Imagine that your website has both regular news articles and product detail pages that highlight features, as well as some landing pages specifically for event promotion.If all pages follow the same template, it is difficult to distinguish them visually and functionally, and it is also impossible to optimize the presentation of content specifically.

To set an independent template for AnQiCMS documents or categories, it means you can:

  • Strengthen brand image:Specific content (such as company profile, core products) can adopt more brand-characteristic templates to deepen the impression of users.
  • Optimizing user experience: According to the type of content (article, product, event), provide the layout and functions that best match the user's reading and browsing habits.For example, the product page can have large image displays and parameter comparisons, while the news page focuses on text reading.
  • Enhance marketing effectiveness: Create customized landing page templates for specific marketing activities to better guide user conversion.
  • A/B testing and optimization: Try different template layout effects and continuously optimize the content presentation strategy through data analysis.

The template mechanism of AnQiCMS is very flexible, it stores all the template files in./templateUnder the root directory, and with.htmlas the file extension. You just need to create or modify these.htmlfiles and upload them to your theme folder, and you can configure them in the background.

Set a separate display template for a single document

When you need to give a unique appearance to a specific article, product, or document under any model on a website, AnQiCMS provides an intuitive settings entry.

First, you need to create a new one in the template design package you are currently using.htmlTemplate file. For example, if you want to create a dedicated template for a document introducing corporate recruitment, you can name itcareer.html. In thiscareer.htmlIn the file, you can freely design the layout, refer to images, styles, and scripts, and use various template tags provided by AnQiCMS (such asarchiveDetail/systemetc) to dynamically call document content.

The file has been created and uploaded to your template design package (for example/template/您的主题名称/career.html) Next, it is time to apply this template to the specific document.

You need to log in to the AnQiCMS backend, go toContent Management, selectPublish documentor edit an existing document. In the document editing interface, you will see a name calledDocument TemplateThe field. Here, you just need to fill in the template file name you just createdcareer.htmlAnd then. After saving the document, when the user accesses this document, AnQiCMS will automatically load and render itcareer.htmlTemplate, rather than the default document details template.

This setting allows you to easily customize the display of each document, whether it is a special product introduction, a detailed white paper download page, or a promotional content for a limited-time event, you can have a tailored presentation style.

Set an independent display template for the entire category

In addition to customizing for individual documents, AnQiCMS also allows you to set independent display templates for the entire document category.This means that all list pages of articles belonging to this category will use the template you specify, which is very useful for maintaining a unified style of category content, highlighting the theme of the category, or achieving specific list display logic.

The operation process is similar to the document template. First, you need to create a list page template file in your template design package, such asspecial-category-list.htmlIn this file, you can usearchiveListtags to cyclically display the abstracts of articles under the category and design the list layout you expect.

complete the creation and upload of the template file (for example/template/您的主题名称/special-category-list.htmlAfter that, please log in to the AnQiCMS backend and navigate toContent Managementand then clickDocument Category. Find the category you want to set a custom template for and click edit. In the category edit page, you will see a field namedcategory templateThe field. Enter it herespecial-category-list.html.

There is an option to note:Apply to subcategory.By default, the template you set for the parent category will not be automatically inherited by its subcategories.If you want this template to also apply to all subcategories under this category, then please set this option to 'inherit'.special-category-list.htmlTemplate.

In addition, there is a particularly useful feature in the category settings:Document Template. This field allows you toAll documents under this categorySpecify a unified detail page template. This means that if you want all the product detail pages of a certain product series to use the same unique layout, you can set a general document detail template here (for exampleproduct-detail-layout.html), so there is no need to set a template for each product document one by one.

Set an independent display template for a single page.

The single-page feature of AnQiCMS (such as "About UsThis provides great convenience for creating independent pages with unique styles, such as corporate milestone displays, team introductions, or specific promotional landing pages.

And like the document and category, you first need to create a new single-page template file, such ascompany-profile.html, and upload it to your template design package, for example/template/您的主题名称/company-profile.html). In this template, you can fully utilizepageDetailtags to display single page content.

Next, log in to the AnQiCMS backend, enterPage Resources, clickPage Management. Find the single page you want to customize, click edit. Find in the single page editing interfaceSingle page templatefield and enter the name of the template file you createdcompany-profile.htmlAfter saving, the single page will appear to the visitor with the exclusive template you designed.

Practical tips

  • Clear naming conventions:Name your custom template file clearly and descriptively, for exampleproduct-review-detail.htmlorevent-list-new-year.htmlThis makes it easy for you to find and manage them among many template files.
  • Make good use of template inheritance:When creating a custom template, you do not have to start from scratch. AnQiCMS supports the Django template engine syntax in{% extends 'base.html' %}tags. This means you can create a generalbase.htmlA skeletal template that includes the common header, footer, and sidebar elements of the website, and then through the custom template{% block content %}Use tags to fill in or rewrite specific areas of content, greatly improving development efficiency and consistency of templates.
  • Test and back up in a timely manner:Always test the template after modifying or adding it on the front-end page to ensure it displays correctly. At the same time, develop the habit of regularly backing up the template files to prevent unexpected situations.
  • Ensure the template file exists:When specifying the template file name in the background, AnQiCMS will not automatically check if the file exists.If the template file entered does not exist, it will cause the page to fail to open normally.Therefore, please make sure that you have uploaded the template file to the correct path.

This flexible template setting capability provided by AnQiCMS allows the display of website content to be unrestricted by a single layout. You can create a more attractive and feature-rich personalized experience for your website based on your business needs and content characteristics.

Frequently Asked Questions (FAQ)

1. I have set up a custom template filename in the background, but the front-end page won't open. What's the matter?This is usually because the template file you have entered does not exist in your theme folder, or the filename is incorrect. Please carefully check the names you have entered in the fields 'Document Template', 'Category Template', or 'Single Page Template' in the back-end, to ensure that they match the actual files you have uploaded/template/您的主题名称/Under the directory.htmlThe filename is exactly the same, including case.

2. What is the difference between the 'Category Template' and 'Document Template' fields when setting a custom template for categories?“Category Template” field

Related articles

How does AnQiCMS handle images in document content to optimize front-end display (e.g., Webp, compression)?

Images are an indispensable part of website content, they can make the page more attractive and convey richer information.However, if images are not optimized, the large file size often leads to slow website loading, severely affecting user experience and search engine rankings.AnQiCMS provides a series of powerful optimization functions when processing images in document content, helping us easily cope with these challenges to ensure that the front-end display is both beautiful and efficient.

2025-11-07

How to create and manage multiple sites in AnQiCMS to achieve independent content display?

AnQiCMS is an efficient enterprise-level content management system, and its multi-site management function is undoubtedly an important tool for many enterprises and operators to improve efficiency and segment the market.By creating and managing multiple independent sites under an AnQiCMS instance, we can flexibly provide customized content display and services for users of different brands, business lines, or regions.

2025-11-07

What template file types and organization modes does AnQiCMS support to control the display of the page?

## AnQiCMS template files and organization methods: The secret to flexible control of page display In the digital age, the visual presentation and content layout of a website are the core of attracting users and conveying information.An excellent content management system should also provide highly flexible page display control capabilities, in addition to powerful content management functions.AnQiCMS is designed based on such an idea, it not only makes content publishing efficient, but also gives users the powerful ability to customize the appearance of the website at will through its unique template file type and organizational mode.

2025-11-07

How to use AnQiCMS template tags to flexibly display different types of content?

AnQiCMS as an efficient and flexible content management system, its template tag system is the key to our website content operation and display.It provides a set of intuitive and powerful tools that allow us to present the content of the backend management in various styles according to different scenarios and needs, thereby greatly enhancing the flexibility and user experience of the website.

2025-11-07

How does AnQiCMS optimize the URL structure through pseudo-static rules to improve search engine results display?

In today's digital marketing environment, a website's URL structure is not just an access address, but also a key element for user experience and search engine optimization (SEO).A clear and meaningful URL can enhance user trust and help search engines better understand the content of the page, thereby improving the display and ranking of the website in search results.AnQiCMS (AnQi Content Management System) fully understands this, and therefore its design in the field of pseudostatic rules provides powerful tools for website operators to optimize URL structure and stand out in search engines.

2025-11-07

How to ensure that AnQiCMS multilingual content switches and displays correctly on the front end?

Today, making a website support multilingual switching and display has become an important link for many enterprises to expand into the international market.AnQiCMS with its flexible architecture provides an efficient way to achieve this goal.This article will deeply explore how to configure and manage multilingual content in AnQiCMS, ensuring that they can be correctly switched and displayed on the front-end website, thus providing a high-quality browsing experience for users of different languages.

2025-11-07

How does AnQiCMS improve website page loading speed and display experience through static caching?

In the digital age, the loading speed of websites has become a key indicator of user experience and search engine rankings.A website that responds quickly can effectively enhance user satisfaction, reduce the bounce rate, and bring better exposure to the content.AnQiCMS is a content management system focused on high performance and efficiency, and the static caching mechanism plays a crucial role in improving website loading speed.

2025-11-07

How to use AnQiCMS built-in tags to retrieve and display system configuration information (such as website name, Logo)?

It is crucial to maintain consistency and ease of updates in website operation and management.AnQiCMS as an efficient content management system fully considers this point, providing powerful built-in tag functions, allowing the global configuration information of the website (such as website name, Logo, filing number, etc.) to be easily dynamically obtained and displayed in the front-end template.This means you do not need to hardcode, just make a change in one place in the background, and all pages referencing this information will update automatically, greatly enhancing the maintainability and operational efficiency of the website.

2025-11-07