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.

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.