What are the naming conventions for the document detail page and list page template files in AnQiCMS?

Calendar 👁️ 82

As an experienced website operations expert, I am well aware that the naming rules of a content management system template are not only technical details but also the foundation of content operation efficiency and website maintainability.AnQiCMS (AnQiCMS) with its flexible and efficient design concept, also provides clear and practical naming conventions in template management, allowing developers and operators to operate with ease.Today, let's delve into the naming rules of the document detail page and list page template filenames of AnQiCMS to help you better master this powerful tool.

Basic conventions for AnQiCMS template files

Before delving into specific naming conventions, we first need to understand some basic conventions of the AnQiCMS template files. All template files use.htmlAs a file suffix, and placed in the root directory of the website/templateTemplate folder in.This means that no matter how many themes your website has, they will each have their own independent subdirectories in this directory.In addition, template files are uniformly encoded in UTF-8 to ensure that multilingual content or special characters can be displayed normally.

It is worth mentioning that AnQiCMS also fully considers the needs of mobile terminals.If you choose a code adaptation mode or a PC + mobile mode template, the system allows you to define a template specifically for mobile content.These mobile templates will be stored in the corresponding theme directory.mobileThe internal structure is consistent with the PC template in the subdirectory.

AnQiCMS provides two main modes for template organization to accommodate different development habits: "folder organization mode" and "flattened file organization mode".These modes affect the storage path of the template files, but the core naming logic is the same.article/detail.html. Under the flattened file organization mode, all core template files are directly stored in the theme root directory, distinguished by underscores, for examplearticle_detail.htmlIt is crucial to understand the naming logic behind any pattern.

Document detail page template naming rules

For the document detail page of AnQiCMS, the naming rules demonstrate its high flexibility, supporting general templates and allowing for personalized customization for specific content.

The first, the most basic and the most general detail page template is named according to the "model table name". This means that if you have an "article" model, its default detail page template can bearticle/detail.html(In folder organization mode) orarticle_detail.html(In flattened mode). Similarly, the "product" model corresponds toproduct/detail.htmlorproduct_detail.htmlThis naming method ensures that all content under the same model is presented in a unified style. If not specified otherwise.

Furthermore, AnQiCMS allows us to specify a dedicated detail page template for a single document.This is very useful for pages that require special display effects or independent design, such as an annual report, specific event details, etc.

  1. Customization based on document ID: /{模型table}/detail-{文档ID}.htmlor{模型table}/{文档ID}.htmlDepending on the system configuration and default custom rules). For example, the exclusive template for an article with ID 10 can bearticle/detail-10.htmlorarticle/10.html. The system will prioritize matching this template with an ID, if it exists, otherwise it will fallback to the generic one.detail.html.
  2. Customized based on the name:The AnQiCMS backend provides a 'Document Template' field when publishing or editing documents. You can directly enter a custom template filename here, such asdownload.htmlIf the file exists in your template package, the system will use it to render this document. This method's flexibility lies in the fact that you can create a page for "About Us".page/about.htmlTemplate, then in the background single-page management, specify the template of the single page "About Us" asabout.htmlwithout concerning about its ID.

For the detail page of a single page (Page), the rules are similar, the default general template is usuallypage/detail.htmlorpage.html. And a specific single page can also be achieved throughpage/detail-{单页ID}.html/page/{单页ID}.htmlor a custom template name (such aspage/about.html) to achieve customization.

Template naming rules for the document list page

Similar to the detail page, the naming of the template for the document list page also follows general and specific principles, mainly centered around the core concept of "classification".

In most cases, all category list pages under a model will share a common template. For example, all article category list pages will use the default template.article/list.html(Folder Organization Mode) orarticle_list.html(Flat mode). This means you can design a unified list page layout for articles, products, and other models, which includes elements such as article titles, summaries, thumbnails, and other conventional elements.

However, in actual operation, we often encounter certain categories that require a unique display style.For example, a 'news center' category may need to display more news headlines, while a 'industry report' category may need a simpler list of reports.

  1. Customized based on category ID: /{模型table}/list-{分类ID}.htmlFor example, the category with ID 5, its list page template can be:article/list-5.htmlWhen the user visits this category, the system will first look for this specific template.
  2. Classification backend specifies the template:In the AnQiCMS backend, there is a "Document Category" management where there is a "Category Template" field. You can specify a custom template filename for a specific category here, for example,product/promotions.html. The list content under this category will be displayed according topromotions.html. This style is particularly suitable for special categories that require independent layouts.

Summary and practical application

The template naming rules of Anqi CMS provide a clear and flexible mechanism.It allows us to design uniformly from the general model level to the fine-tuning of specific categories and even individual documents.This hierarchical naming and backend specification greatly enhance the efficiency of template development and the freedom of content display.As an operator, this means we can flexibly adjust the page layout and style based on specific content strategies and marketing needs, without having to delve into the core code, thus better supporting SEO optimization, improving user experience, and achieving content monetization goals.

Familiarize and make good use of these naming rules, and it will enable you to soar in your content operation work on AnQiCMS, easily building websites that are more attractive and meet business needs.


Frequently Asked Questions (FAQ)

1. If I specify a particular template filename for a document (for examplearticle/detail-10.html), but the file does not exist, how will the system handle it?

AnQiCMS is very intelligent. If the system cannot find the personalized template file you specified for a specific document or category (such asarticle/detail-10.html),It will automatically revert to the general template of its belonging model (for examplearticle/detail.htmlThis ensures that the website's access will not be interrupted due to the missing of a specific template, ensuring the continuity of user experience.

2. In addition to naming specific templates using IDs (such as list-5.html),I can use a custom name, such asarticle/latest-news.html?

Of course you can.AnQiCMS in the background provides "Document Category" and "Document Release" interface, both of which have "Classification Template" and "Document Template" fields.latest-news.htmlorabout-us.html.The system will look for the corresponding file in the template directory according to the name you enter.This way provides greater freedom, allowing you to name templates based on content themes or functions rather than just relying on numeric IDs.

3. How do the 'Folder Organization Mode' and 'Flattened File Organization Mode' affect the naming of detail page and list page templates?

These modes mainly affect the storage path of template files and the separator in file names.

  • Folder organization mode:Template files will be stored in subfolders categorized by content type. For example, an article detail page might betemplate/你的主题/article/detail.html, an article list page might betemplate/你的主题/article/list.html. Specific templates might betemplate/你的主题/article/detail-10.html.
  • Flattened file organization mode:All core template files are directly stored in the theme root directory, distinguished by underscores to differentiate content types. For example, the article detail page might betemplate/你的主题/article_detail.html, an article list page might betemplate/你的主题/article_list.html. Specific templates might betemplate/你的主题/article_detail-10.html.

In any pattern, the core naming pattern ({模型table}/detail.html/{模型table}/list-{分类id}.htmletc.) is consistent, just the slashes in the path and filename/may be replaced by underscores_Substitute, or the file is flattened. You can choose the most suitable organization method according to the development habits of the team.

Related articles

How to include header, footer, and other common code snippets in AnQiCMS templates?

## AnQiCMS template development: clever integration of common code snippets, making your website maintenance more efficient When operating a website, we often find that many pages share the same basic structure, such as the website header, footer, sidebar navigation, or a general ad slot.If you have to rewrite this code for each page repeatedly, it is not only inefficient but also, once you need to make changes, you have to adjust them one by one, which is undoubtedly a nightmare for website maintenance.It is good that AnQiCMS is an enterprise-level content management system developed in Go language

2025-11-07

What template types does AnQiCMS support (adaptive, code adaptation, PC + mobile)?

## AnQiCMS Template World: Flexible for various screens, making your website omnipresent In the wave of digitalization today, whether your website can seamlessly present on various devices is directly related to user experience and brand image.As an experienced website operations expert, I am well aware of the importance of a flexible and efficient content management system (CMS) to a company.

2025-11-07

How to use variables and control tags in AnQiCMS templates?

AnQi CMS, an enterprise-level content management system built based on the Go programming language, which provides strong support for content operators and corporate users with its high efficiency, security, and flexibility.In AnQiCMS, content is not just static text and images, through its carefully designed template engine, we can transform data into vivid and personalized web pages.

2025-11-07

What are the specifications for the template file suffix and storage directory of AnQiCMS?

AnQiCMS as an efficient and customizable enterprise-level content management system, follows a clear and flexible set of rules in the organization and use of template files.For website operators and developers, a deep understanding of these regulations not only ensures the correct presentation of front-end content on the website but also provides great convenience in content layout and personalized customization.Today, let's unveil the mystery of AnQiCMS template files together and see what suffixes and directory secrets they have.First, AnQiCMS

2025-11-07

What are the functions of the 38 commonly used tags in AnQiCMS templates?

As an experienced website operations expert, I have a deep understanding of the powerful functions of AnQiCMS (AnQiCMS) and its flexible template system.It is not just a content management system, but also a tool that empowers enterprises and content operation teams, especially in terms of content display and management. Its core lies in a set of elegantly designed and feature-rich template tags system.Today, let's delve deeply into the 38 commonly used tags in the Anqi CMS template, see what roles they play, and how they help us easily build and manage all kinds of websites.

2025-11-07

How to use the `archiveList` tag to get the document list in AnQiCMS template?

As an experienced website operations expert, and deeply familiar with AnQi CMS, I fully understand that how to efficiently obtain and display content is the core of building a website.Today, let's delve deeply into an extremely important and powerful tag in the Anqi CMS template, `archiveList`, which can help us flexibly obtain various document lists and provide endless possibilities for the presentation of website content.

2025-11-07

How to use the `archiveDetail` tag to get detailed information of a specific document?

As an experienced website operation expert, I know that content is the soul of the website, and how to efficiently and accurately present these contents is an indispensable part of our daily work.In such a powerful content management system as AnQiCMS, making good use of the template tags provided can greatly enhance our content operation efficiency.

2025-11-07

How to implement navigation between previous and next document sections using the `prevArchive` and `nextArchive` tags?

## Easily Navigate: How to Use `prevArchive` and `nextArchive` Tags for Smart Article Navigation in AnQiCMS As an experienced website operator, we know that website content is not just about publishing. How to allow users to smoothly browse through massive amounts of information and find the next article they are interested in is crucial for improving user experience, extending stay time, and even optimizing SEO. In the powerful and flexible content management system AnQiCMS (AnQiCMS)

2025-11-07