What is the default template file name for the document detail page and list page?

Calendar 👁️ 54

When using AnQiCMS for website construction and content management, understanding the naming conventions of its template files is crucial for customizing and optimizing the website's appearance.The Anqi CMS simplifies template management by providing a flexible and default recognition naming convention, allowing developers and operators to work more efficiently.

Firstly, all template files are统一使用.htmlAs a suffix, and placed centrally in the root directory of the website/templateIn the folder. While the styles, JavaScript scripts, images, and other static resources used in the template will be stored separately in/public/static/Directory. The Anqi CMS template engine syntax is similar to Django templates, which allows users familiar with this syntax to quickly get started.

The strength of AnQi CMS lies in its ability to intelligently recognize and automatically apply template files that conform to specific naming rules, without requiring additional configuration in the background.This greatly accelerates the development and deployment process. For document detail pages and list pages, there are several main default template file naming methods:

Default template file for the document detail page

The document detail page is the core page for displaying single content (such as articles, product introductions). Anqi CMS provides two default naming modes to meet different customization needs.

A precise match is one that is specific to a particular document ID:{模型table}/{文档id}.htmlHere,{模型table}represents the table name of the content model to which the document belongs (for example, if it is an article model, it might bearticleIf it is a product model, it may beproduct),while{文档id}This is the unique identifier of the document in the system. This means that if you want to design a unique detail page layout for a specific document (such as an article with ID 10), you can createarticle/10.htmlSuch a template file. When accessing this specific article, the system will try to load this exact matching template first.

Another is a general match for the entire content model:{模型table}/detail.html. If a specific document does not have a dedicated{文档id}.htmltemplate, or if you want to provide a unified page layout for all documents under a specific content model, you can create a nameddetail.htmlThe file, and place it in the corresponding content model (such asarticleorproduct) folder, formingarticle/detail.htmlorproduct/detail.html. So, all documents under this model will use this by default when accesseddetail.htmlTemplate.

The default template file for the document list page

The document list page is used to display multiple articles under a certain category, and also provides flexible naming methods.

One is an exact match for a specific category ID:{模型table}/list-{分类id}.html. Similar to the document detail page, here the{模型table}represents the table name of the content model, and{分类id}It is the unique ID of the document category. If you want to design a unique list page for a specific category (for example, a product category with ID 5), you can createproduct/list-5.htmlSuch a template. When accessing the list page of this specific category, the system will load this template first.

Another is a general match for the entire content model:{模型table}/list.htmlIf a list template for a specific category ID is not found, or if you want to provide a uniform layout for all list pages under a specific content model, you can create a namedlist.htmlThe file, and place it in the corresponding content model (such asarticleorproduct) folder, formingarticle/list.htmlorproduct/list.html. All category list pages under this model will use this by default when accessedlist.htmlTemplate.

Default template file for a single page (additional notes)

Although it is not a document detail or list page, understanding the naming rules of single-page templates can also help us better understand the template mechanism of Anqi CMS. Single pages, such as "About Us", "Contact Us", also have similar default names:

  • For an exact match of a specific single page ID:page/{单页面id}.html
  • For a general match of all single pages:page/detail.html

It should be noted that the aforementioned naming rules apply to both “folder organization mode” and “flattened file organization mode”. In the “folder organization mode”, template files are stored in their respective subdirectories according to the model and page type; while in the “flattened file organization mode”, the filenames will contain information about the model and page type (such as{模型table}_detail.htmlorpage_detail.htmlBoth of these modes follow the same priority and automatic recognition logic.

By these default naming conventions, we can quickly apply different designs to the document detail page and list page of the website without modifying the background configuration.Of course, AnQi CMS also provides the function to specify a custom template file for specific documents, categories, or single pages in the backend management interface, which provides additional flexibility for more detailed personalized needs.Understanding these naming rules will greatly enhance our efficiency in website customization and content operation on AnQi CMS.


Frequently Asked Questions (FAQ)

  1. Ask: If I createdarticle/detail-10.htmlandarticle/detail.htmlWhich template will the system prioritize to display the article with ID 10?Answer: The system will prioritize using more specific templates. In this case, it will prioritize choosingarticle/detail-10.htmlTo display the article with ID 10. It will fallback to the general template when the specific ID template cannot be found.article/detail.html.

  2. Question: Where should the table name of the document model be viewed?{模型table}Where should the table name of the document model be viewed?Answer: You can find the 'Content Model' settings in the 'Content Management' module of the Anqi CMS backend. Each content model will have a 'Model Table Name' or 'URL Alias' field, which is used in template naming.{模型table}Values, usually lowercase English words, such asarticle/productetc.

  3. Question: If my website has separate templates for mobile and PC, do these default filenames also apply to the mobile端?Yes, these default naming rules also apply to the mobile template. In the AnQi CMS template root directory/templateBelow, if there is onemobileThe subdirectory, so the mobile template files should be stored inmobilethe directory, and follow the same naming conventions. For example, the mobile article detail page template might bemobile/article/detail.html.

Related articles

How can we design and display a separate content template for mobile devices to optimize the mobile user experience?

It is crucial to optimize the mobile user experience for modern website operations, and designing content templates specifically for mobile devices is an efficient way to achieve this goal.AnQi CMS provides a flexible mechanism, allowing users to provide the most suitable browsing experience for different terminals according to their needs.### Understanding AnQi CMS Mobile Template Mode AnQi CMS is designed to meet the diverse mobile adaptation needs and includes three main website modes that determine how content is displayed to mobile users: * **Responsive Template Type**

2025-11-08

What template types does AnQiCMS support to adapt to the display of content on different devices?

In today's digital world, users access websites through various devices, which has become the norm.From wide PC monitors to palm-sized smartphones, how to present website content seamlessly and efficiently is a challenge that every operator must face.AnQiCMS deeply understands this, providing users with a variety of flexible template adaptation strategies to ensure that your website can display the effect on different devices.AnQiCMS mainly supports three template types to adapt to the content display of different devices, each type has its unique application scenarios and advantages, and you can choose according to your own business needs and operational strategy

2025-11-08

How to customize independent display templates for different categories or single pages?

In website operation, we often hope to design unique display styles for different content types or specific pages.For example, a news article may require a concise and clear list style, while a product introduction may focus more on images and detailed specifications;The "About Us" page often requires a separate design to reflect the brand image.AnQiCMS (AnQiCMS) fully understands the importance of these personalized needs, providing flexible template customization features that allow you to easily create a unique visual experience for different parts of the website without delving into code.Security CMS based on Go language development

2025-11-08

How to reuse header, footer, and other common modules in AnQiCMS templates to display content?

During the process of website construction, headers, footers, navigation bars, and other common modules are almost indispensable on each page.If each time these codes are manually written, it is not only inefficient but also difficult to ensure the consistency of the overall style of the website, and the subsequent maintenance work will become particularly cumbersome.AnQiCMS as an efficient content management system, its powerful template engine provides a variety of flexible ways to reuse these common modules, thereby greatly enhancing the efficiency of template development and the maintainability of the website.### The Way of Reusing Common Modules in AnQiCMS Template First

2025-11-08

How to customize a dedicated content display template for a specific document ID or category ID?

In website operations, we often encounter such needs: a particular product display page needs a unique layout to emphasize its features, or an important event special page needs special design to attract users, or a "About Us" single-page site wants to show a different brand character.Anqi CMS provides us with a flexible way, allowing us to customize exclusive display templates for these unique content needs, thus greatly enhancing the visual appeal and user experience of the website.The Anqi CMS template system has adopted the Django template engine syntax

2025-11-08

How to retrieve and display the system configuration information of the website in the template?

In website operation, we often need to display some global website information, such as the website name, Logo, filing number, copyright statement, as well as custom contact information or social media links.This information, if directly hardcoded in the template, would require searching and updating each page whenever a modification is needed, which is time-consuming and prone to errors.The AnQi CMS provides a very powerful and convenient template tag —— the `system` tag, which allows these system configuration information to be dynamically obtained and displayed in the template, greatly enhancing the maintainability and operational efficiency of the website.###

2025-11-08

How to display contact information on the page, such as phone number, address, etc.

The contact information of the website is an important part of establishing user trust and providing convenient services.Whether it is displaying a simple phone number at the bottom of the website or providing detailed addresses and social media links on the "Contact Us" page, Anqi CMS offers a flexible and efficient way to manage and present these key information.This article will delve into how to set up and display all the contact information on your website using Anqi CMS, ensuring that your customers can easily find you.### Backend Management:Unified setting your contact information In AnQi CMS

2025-11-08

How to dynamically display SEO titles, keywords, and descriptions (TDK) on different pages?

In website operation, Search Engine Optimization (SEO) is a key element in enhancing website visibility.Among them, the page title (Title), keywords (Keywords), and description (Description), abbreviated as TDK, play a crucial role.They are not only the primary information that search engines understand the content of the page, but also an important factor in attracting users to click.In AnQiCMS (AnQiCMS), we can easily implement the dynamic display of TDK, allowing each page of the website to have appropriate and attractive TDK information

2025-11-08