What is the default naming rule for the template files of the model home page, document detail page, and document list page?

Calendar 👁️ 50

As an experienced CMS website operation personnel of an enterprise, I know that a clear and efficient template naming rule is crucial for the management of website content and user experience.AnQi CMS provides great flexibility in template design, and also establishes a set of default naming conventions, which is very helpful for us to quickly build and iterate website pages.

All template files in Anqi CMS are named with.htmlAs a suffix, and uniformly stored in the root directory of the system./templateFolder. Each independent template set will have its own directory and must include aconfig.jsonFiles to define the basic information of the template. The CSS, JavaScript, images, and other static resources that the template depends on are recommended to be managed centrally in/public/static/Catalog, to ensure a clear structure and convenient maintenance.

AnQiCMS provides two main modes of organization for templates:Folder organization modeandFlat file organization modeThese two patterns are slightly different in naming, but both aim to provide consistent and easy-to-understand conventions.

For the content model homepage, this is usually a preview page showing all documents under a certain content model. InFolder organization modeThe default naming convention is{模型table}/index.html. For example, if the table name of your content model isarticleThen the homepage template file of the article model isarticle/index.htmlAndFlat file organization modeIn{模型table}_index.html, that isarticle_index.htmlBy this means, the system can clearly identify and load the homepage of the corresponding model.

This is the page that displays the complete content of a single document for the document detail page. InFolder organization modethe following, the default general template file is{模型table}/detail.htmlIn addition, AnQiCMS also supports customizing templates for specific document IDs, following the naming rule is{模型table}/detail-{文档ID}.htmlor more generally,{模型table}/{文档ID}.htmlThis means you can provide a unique display layout for a special document.Flat file organization modeIn the document detail page, the default template file name is{模型table}_detail.html. Although the flattened mode does not explicitly list the ID-specific template, it usually follows a concise_detail.htmlas a general detail page.

Finally, there is the document list page, which is used to display the document list under a certain category. InFolder organization modeIn it, the default general template file is{模型table}/list.htmlIf you need to customize the list page for a specific category, the system will look for{模型table}/list-{文档分类ID}.htmlFor example, the list page of articles with category ID 10 might bearticle/list-10.html.Flat file organization modeIn it, the default template file name for the document list page is{模型table}_list.htmlThis convention makes it easy for us to customize the display of list pages for different models and classifications.

Understand and follow these default naming conventions, which can help us be more efficient in template development and content management.At the same time, Anqi CMS also provides a flexible customization mechanism, allowing us to specify unique template file paths for specific content (such as single pages) in the background, further meeting personalized needs.This design combines convention and flexibility, which is exactly what AnQiCMS provides in content operation.


Frequently Asked Questions (FAQ)

1. If I create a template file with a specific ID for a particular document or category but the file does not exist, how will the system handle it?

AnQiCMS will first attempt to find a template file specific to the ID, if the file does not exist, the system will automatically fallback to finding more generic template files. For example, for the document detail page, if{模型table}/detail-{文档ID}.htmlDoes not exist, the system will try using{模型table}/detail.html. If there is no document list page,{模型table}/list-{文档分类ID}.htmlthe system will fallback to using{模型table}/list.htmlThis fallback mechanism ensures that the website can still display normally even if no specific templates are created for each content, thus avoiding page errors.

2.{模型table}/{文档ID}and{文档分类ID}What does the placeholder specifically represent? How can I obtain this information?

{模型table}It refers to the table name of your content model in the AnQiCMS database, for examplearticle(Article model) orproduct(Product model). You can view or set the "model table name" field for each model in the "Content Management" -> "Content Model" section of the AnQiCMS backend.{文档ID}It refers to the unique identifier ID of the specific document you publish in the AnQiCMS backend, which can be seen in the document list and editing page.{文档分类ID}This refers to the unique identifier ID of the category to which your document belongs, which can be viewed on the document category management page. This information can be directly obtained from the background management interface.

3. The template files, in addition to.htmlsuffix, what encoding or storage requirements should be noted?

All template files are encoded in UTF-8 format. Using other encoding may cause the page to display garbled text and not display normally.Especially Windows users should save template files as UTF-8 encoding when editing them.At the same time, the static resources such as styles, JS scripts, images, and so on used by the template should be stored independently./public/static/directory should not be confused with the template files to maintain the clarity and ease of project structure maintenance.

Related articles

What should the default naming of the homepage template file be?

As an experienced CMS website operation personnel, I fully understand the importance of the homepage in attracting and retaining users. It is the first impression of users visiting the website and also the core hub of content layout and information communication.For Anqi CMS, understanding the naming conventions of its template files, especially the default naming of the homepage template file, is the foundation for ensuring the smooth operation and efficient management of the website.The Anqi CMS system defaults to identifying the homepage template file as `index.html`.This file is the entry point of your current theme template

2025-11-06

How to create and reference reusable code snippets like sidebars, breadcrumbs, etc. in templates?

As an experienced CMS website operation person in a security company, I am well aware of the importance of efficient content management and flexible template customization for website operation.In daily work, we often need to deal with various page elements, such as sidebars, breadcrumb navigation, headers, and footers, etc., which appear repeatedly on multiple pages.It is crucial to modularize and reuse these commonly used code snippets in order to improve development efficiency, ensure code consistency, and simplify maintenance work.AnQi CMS provides a powerful and easy-to-use template engine, allowing us to easily achieve this goal.

2025-11-06

How should common code snippets like headers, footers, etc. be organized and stored during template creation?

As a website operator familiar with Anqi CMS, I am well aware of the importance of a well-structured and easy-to-maintain template for the long-term healthy operation of the website.How to efficiently organize and store common page headers, footers, and other reusable code snippets during template creation is crucial for improving development efficiency and ensuring website consistency.In Anqi CMS, the template system uses a syntax similar to the Django template engine, which provides us with powerful tools to achieve code reuse and modular management.

2025-11-06

How to control the enable status of the template through the `status` field in `config.`?

In the daily operation of Anqi CMS, we often need to adjust the appearance and layout of the website, which usually involves switching or enabling different templates.AnQi CMS provides an intuitive and efficient way to manage the enabled status of templates, which is mainly achieved through the `status` field in the `config.` file under each template directory.

2025-11-06

How can I customize the templates for 404, 500 error pages, and site shutdown notification pages?

As a senior security CMS website operator, I fully understand the importance of every user touch point, including those unusual pages, in carrying the brand image and user experience.A meticulously customized 404, 500 error pages, and site shutdown notification pages, which not only enhance the professionalism of the website but also provide guidance to users when they encounter problems, effectively reduce the bounce rate, and maintain a good search engine impression. Next, we will discuss in detail how to customize these special pages in Anqi CMS.

2025-11-06

What are the differences between the 'Folder mode' and 'Flat mode' in the template file organization pattern?

As a senior security CMS website operations personnel, I am well aware of the importance of template file organization methods for website post-maintenance, content release efficiency, and team collaboration.In AnQi CMS, the organization mode of template files is mainly divided into two types: 'folder mode' and 'flattened mode', each with its own characteristics and suitable for different project needs and team habits.Understanding the differences between these two patterns can help us better choose and manage templates.First, let's delve deeper into the **folder organization pattern**.

2025-11-06

How to implement template customization for specific categories or pages, for example `page/about.html`?

As an experienced CMS website operator, I am well aware of the importance of content presentation for user experience and Search Engine Optimization (SEO).AnQiCMS provides a powerful and flexible template customization mechanism, allowing us to create exclusive visual and functional layouts based on different content types or specific page requirements.Today, I will detail how to implement template customization for specific categories or pages in AnQiCMS, such as the needs we often encounter, such as `page/about.html`.

2025-11-06

How to call and display the name, Logo, and other system global configuration information in AnQi CMS template?

As an experienced security CMS website operations personnel, I am well aware of the importance of the global configuration information of the website, such as the website name and logo, for the unified display of the brand image and user recognition.In AnQi CMS, these core information is unifiedly managed, and through a concise and efficient template tag mechanism, it allows operators to easily call and display on various pages of the website. ### Management of website global configuration information in AnQi CMS AnQi CMS centralizes the global configuration information of the website in the "Global Function Settings" module of the background.

2025-11-06