In website operation, template management is the key to ensuring the professionalism and consistency of content display.For many operators, manually selecting or specifying a template for each new article and each new category is undoubtedly a repetitive and time-consuming task.AnQi CMS understands this pain point and therefore introduces a set of intelligent naming conventions, allowing the system to automatically identify and apply default display templates, thereby greatly simplifying our daily operations.

The cleverness of this function lies in the fact that AnQiCMS can intelligently associate content with preset design styles according to the specific naming rules of template files.This means, as long as our template file follows these conventions, the system can act like an efficient assistant, automatically finding a suitable "dressing" for the content, thus saving us the trouble of configuring each one individually.

In particular, this naming convention is mainly reflected in the following types of content:

FirstlyDocument detail page. When you want a specific article or product detail page to have a unique layout and don't want to manually select a template each time, AnQiCMS allows you to name conventions via document ID.The file format is{模型table}/{文档id}.htmlFor example, if your article model (usually namedarticle) There is an article with ID 123, then you can create a folder named in your template folderarticle/123.htmlfile. When the user accesses this article with ID 123, AnQiCMS will automatically load this exclusive template without any separate setting in the background. Here is the{模型table}It is the table name corresponding to the content model in the database, for example, articles are usuallyarticle, products areproduct.

Next isCategory list page. The document list under a certain category, AnQiCMS also supports the application of automated templates through naming conventions. Its file format is{模型table}/list-{分类id}.htmlFor example, if you have a category with ID 45 and it belongs to the 'article' model, and you want its list page to have a special layout, then you just need to createarticle/list-45.htmlThis file. AnQiCMS will automatically apply it on the list page of the category, so that the content under the category will be presented in the style you expect.

Furthermoresingle page. For independent pages such as “About Us”, “Contact Information”, or any custom static pages, the naming convention still applies. The file format ispage/{单页面id}.htmlFor example, if your "Contact Us" page ID in the backend is 78, you can create a name forpage/78.htmlThe template file. When the user accesses this single page, the system will intelligently call the exclusive template you have set for the page with ID 78.

It is worth emphasizing that AnQiCMS's intelligent mechanism is not a one-size-fits-all solution; it provides a high degree of flexibility. Although naming conventions can automatically apply templates, in the background management interface, we can still target specific documents, categories, or single pages.Manual template settingFor example, when editing a document, you will see a "document template" field;When editing categories, there is a "category template" field; and in single page management, there is also an "single page template" option.These manually set priorities take precedence over naming conventions. This means that you can always break the rules for special content, giving it a completely different design, especially when it comes to specific promotions, A/B testing, or displaying special content. This manual override feature is very practical.It allows us to enjoy the convenience brought by automation while not losing the freedom of personalized customization.

All these, according to the naming convention or manually specified template files, need to be stored uniformly in the template theme directory currently in use./templatein the folder. For example, if your template theme name is "default", then these files will be placed intemplate/default/Inside the directory. In addition, AnQiCMS supports responsive design, if your website needs a separate mobile template, just create it in the template theme directory.mobileSubdirectory, and place the corresponding template files according to the same naming convention in it.

In conclusion, AnQiCMS greatly simplifies the application and management of website templates through a set of intelligent naming conventions.It makes the connection between content publishing and page design more smooth, helping operators to significantly improve work efficiency while ensuring the professionalism and consistency of the website.This balance between efficiency and customization is exactly what AnQiCMS is committed to creating for users.


Frequently Asked Questions (FAQ)

  1. Which has a higher priority, the template applied automatically by the naming convention or the template manually set in the background?The template specified manually for documents, categories, or single pages has a higher priority.If the background manually sets a template, even if there is a template file that conforms to the naming convention, the system will prioritize using the manually specified template.
  2. How will AnQiCMS handle it if I have not created a template file with a naming convention for a specific ID?If AnQiCMS cannot find a template file that conforms to the specific ID naming convention, it will fall back to using the default universal template for the content type (such as article, product, category, single page). For example, if it cannot findarticle/123.htmlIt may try to loadarticle/detail.htmlOr (document details)article/list.html(Category list).
  3. Does this naming convention support all types of content?At present, the naming convention mainly supports document detail pages, category list pages, and single pages.These are the most common and highly customized page types on the website.For other pages like search result pages, tag pages, etc., AnQiCMS usually has fixed default templates or general template tags for us to flexibly call.