How to configure the category template and document template in the background of AnQiCMS to achieve personalized content display?

Calendar 👁️ 70

As website operators, we all hope that our website content can be presented to visitors in the most attractive way.This is not just about visual beauty, but also about how the content structure better serves users and how to highlight the unique brand character of the website.AnQiCMS understands this need and therefore provides a powerful and flexible template configuration function in the background, allowing you to achieve highly personalized display according to different content types - whether it is articles, products, or category pages.

Below, let's learn together how to configure the category template and document template on the AnQiCMS backend, giving your content a unique display style.

The operation mechanism of AnQiCMS templates

Before delving into the configuration, let's first understand the AnQiCMS template system.AnQiCMS uses a syntax similar to the Django template engine, which means you can control page layout and data entry through concise tags.All template files are stored in/templateIn the directory, in the theme folder you have selected, usually with.htmlWith suffix. When you specify a template in the background, the system will go to this directory to find the corresponding file to render the page.This mechanism grants you great freedom to customize the content structure according to your business needs.

AnQiCMS content management is built based on the 'content model', such as article model, product model, etc.Each category and document belongs to a specific content model, and the configuration of the template is also centered around these models to achieve fine-grained content control.

Configure category templates: Define the display method of the content list

Imagine that your 'news center' needs a simple list layout, while the 'product showcase' requires a product grid layout with thumbnails and prices.In AnQiCMS, you can easily achieve these differentiated displays through category template configuration.

To configure the category template, you need to go to the AnQiCMS backend, find the "Content Management" menu on the left, and then click "Document Category."}Here, you can manage all content categories. Select the category you want to configure (such as "News Update" or "Company Products"), click the "Edit" button on the right.

In the "Other Parameters" section of the category editing page, you will see an input box named "Category Template."}This is where you can demonstrate your personalized layout. AnQiCMS defaults to providing a generic list template based on the content model, for examplearticle/list.html(Article model) orproduct/list.html(Product Model). If you want to specify a unique list page for the current category, just enter the custom template filename in this input box, for examplearticle/news-list.htmlorproduct/fancy-gallery.html.

Moreover, there is also an option below to apply it to subcategories.Tick it, all subcategories under the current category will inherit and use this custom category template you set, which is very useful for maintaining the consistency of content structure.Of course, if the sub-categories need a more special display, you can also configure templates for them separately.

Configure document template: Customize detail pages for each piece of content

In addition to the category list, each specific content (whether it's an article or a product) may also require a unique detail page layout. AnQiCMS provides two ways to configure document templates, allowing you to be flexible:

1. To specify a uniform template for all documents under the entire category

When you edit the category, you will also see a 'Document Template' option in the 'Other Parameters' section, in addition to the 'Category Template'. This setting allows you to select a template for the current category under theAll documentsSpecify a unified detail page template. For example, you can specify a template with code highlighting for the "Technical Articles" category, while the "Case Studies" category may require a template that emphasizes images and citation blocks.Enter asarticle/tech-detail.htmlSuch a template filename, all document detail pages in this category will use this template.

2. Configure a dedicated template for a single document

Sometimes, an important article or a featured product needs a completely unique showcase page, unrestricted by the default template of its category.AnQiCMS also considered this point.

When you scroll down to the "Other Parameters" area in the "Content Management" section of the background to "Add Document" or "Edit Document", you will find an input box for the "Document Template".Here, you can specify a completely independent template for the specific document you are currently editing.For example, you can specify for a year-end reportarticle/annual-report.htmlOr specify for a new product release page.product/launch-special.html. Once set, the detail page of this document will prioritize the use of this custom template, overriding the default settings of its category.

Single-page template: flexible presentation of static content

For independent pages like "About Us" and "Contact Information" that do not belong to any model category, AnQiCMS also provides similar template customization capabilities.You can edit a single page under "Page Resources" and "Page Management".Find the 'Single Page Template' option in the 'Other Parameters'.Here, you can specify a 'About Us' page forpage/about-us.htmlThe template, making it stand out throughout the website.

Make the template file truly effective: Create with data calling.

It is not enough to specify the template file name in the background, you need to create the corresponding one in the theme directory of the website.htmlFor example, if you have specified in the backgroundarticle/news-list.htmlAs a template for a certain article category, you need to be in `/template/Your topic name/

Related articles

How to set the automatic compression and thumbnail processing method in AnQiCMS, which affects the image display on the front end?

The quality of website content is often not just reflected in text, but images as visual elements also play a crucial role.In website operation, how to efficiently handle images, ensuring that the images are clear and beautiful while also considering the loading speed, this is the core value of AnQiCMS image processing function.Today, let's delve deeper into how AnQiCMS helps us manage the automatic compression and thumbnail processing of large images, as well as how these settings will affect the display effect of images on the website's frontend.### Say goodbye to slow image loading

2025-11-07

How to implement page layout inheritance and rewriting using the `extends` tag in AnQiCMS templates?

When building a website, maintaining the uniformity of the page style, improving development efficiency, and reducing maintenance costs is the goal pursued by every website operator.AnQiCMS (AnQiCMS) deeply understands this, and its template system design draws on the excellent ideas of the Django template engine, among which the `extends` tag is one of the core functions to achieve this goal. ### The Core Concept of Template Inheritance Imagine you are designing a series of posters.Each poster has a common brand logo, top title, and bottom contact information, with only the promotional content in the middle being different

2025-11-07

How to reuse common code snippets through the `include` tag in AnQiCMS templates to optimize the display structure?

When building and managing websites, improving efficiency and maintaining code neatness is the goal pursued by every operator.AnQiCMS (AnQiCMS) as an efficient content management system, provides powerful template functions, among which the `include` tag is the tool to achieve this goal.It allows us to abstract out repeated code snippets from the website, forming independent modules, and then referencing them where needed, greatly optimizing the template structure and subsequent maintenance work.

2025-11-07

How to define and use variables in AnQiCMS templates to optimize the display and management of content?

In AnQi CMS, flexibly using template variables is the key to optimizing website content display and management efficiency.It not only makes your website content more dynamic, but also greatly improves the maintainability and reusability of the template.This article will delve into how to define and use variables in AnQiCMS templates, as well as how to better present content through these techniques. ### Variables: The Foundation of Living Content Imagine how cumbersome it would be if every title, every paragraph on a website had to be manually modified.The introduction of variables is to solve this pain point

2025-11-07

How to configure banner images and thumbnails for a single page in AnQiCMS to enrich its visual display?

Today, with the increasing richness of website content, relying solely on text to convey information is no longer enough.Visual elements, such as eye-catching banner images and expressive thumbnails, can attract visitors' attention at first glance and enhance the professionalism and user experience of the website.For AnQiCMS users, cleverly configuring these visual elements for single pages (such as "About Us", "Contact Us", or "Service Introduction", etc.) is a simple operation that can bring great benefits.AnQiCMS fully understands the importance of content display and provides an intuitive backend management interface and a flexible template calling mechanism

2025-11-07

How to optimize the display link of category and tag pages by using custom URL aliases in AnQiCMS?

In website operation, the URL (Uniform Resource Locator) is not only the address of the content but also an important component of user experience and search engine optimization.A clear, concise URL that contains keywords, which can help users understand the page content faster and also improve the page ranking in search engines.AnQiCMS as an efficient content management system, provides powerful custom URL aliasing functionality, allowing users to flexibly optimize the display links of category and tag pages.### Understand the importance of URL optimization Before delving into the specific operations of AnQiCMS

2025-11-07

How to use the `archiveFilters` tag in AnQiCMS template to achieve complex content filtering display?

In AnQiCMS, we often need to display website content in various ways, such as by category, tag, or even by the specific attributes of the content.When faced with more complex content organization needs, such as on a product list page, where not only products need to be displayed but also need to be filtered according to custom properties such as "color", "size", "material", etc., the `archiveFilters` tag comes into full play, helping us easily achieve these complex content filtering and display.

2025-11-07

How to replace specific characters in a string in AnQiCMS, affecting the presentation of front-end content?

In website operation, we often encounter situations where we need to modify or adjust the content, which is not just about updating text.Sometimes, we need to replace a specific word on a website with a new expression, or update links in bulk, or even dynamically process certain characters during content presentation.AnQiCMS as an efficient content management system provides a variety of flexible mechanisms to handle string replacement, thereby finely controlling the presentation of front-end content.### Backend bulk replacement: The efficiency tool for global content updates Imagine that the website you operate uses a specific product name

2025-11-07