In website operation, template management is a key factor in 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.[en] AnQi CMS understands this pain point and therefore introduces a set of intelligent naming conventions that allow the system to automatically recognize and apply default display templates, thus greatly simplifying our daily operations.

The cleverness of this feature 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 that as long as our template file adheres to these conventions, the system can act as an efficient assistant, automatically finding the appropriate 'outfit' 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 details page.When you want a specific article or product detail page to have a unique layout without having to manually select a template each time, AnQiCMS allows you to use naming conventions via document ID.{模型table}/{文档id}.html. For example, if your article model (usually namedarticleThere is an article with ID 123 in it, then you can create a file named in your template folderarticle/123.htmlThe file. When the user accesses the article with ID 123, AnQiCMS will automatically load this exclusive template without the need for separate settings in the backend. Here,{模型table}It is the table name corresponding to the content model in the database, for example, articles are usuallyarticle, products areproduct.

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

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

It is worth emphasizing that AnQiCMS's intelligent mechanism is not a one-size-fits-all approach, providing high flexibility. Although naming conventions can automatically apply templates, in the background management interface, we can still target specific documents, categories, or single pages forManual template settings.For 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 a 'Single Page Template' option.These manually set priorities will take precedence over naming conventions.This means you can always 'break the mold' for a special piece of content, giving it a completely different design, especially when it comes to specific promotions, A/B testing, or showcasing 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 directory of the template theme you have currently enabled./templateIn the folder. For example, if your template theme name is “default”, then these files will be placed intemplate/default/Inside the catalog. In addition, AnQiCMS supports responsive design, if your website needs a separate mobile template, you just need to create it in the template theme directory.mobileSubdirectory, and place the corresponding template files in it according to the same naming convention.

In summary, AnQiCMS greatly simplifies the application and management of website templates through a set of intelligent naming convention mechanisms.It makes the connection between content publishing and page design more fluid, helping operators to significantly improve work efficiency while ensuring the professionalism and consistency of the website.This balance between efficiency and customization is the embodiment of AnQiCMS's dedication to creating value for users.


Common Questions (FAQ)

  1. Which has a higher priority, the template applied automatically by the naming convention or the template set manually by the background?The template specified manually for documents, categories, or single pages has a higher priority.If the template is manually set in the background, the system will prioritize the manually specified template even if there is a template file that matches the naming convention.
  2. How will AnQiCMS handle if I have not created a template file that conforms to the naming convention for a specific ID?If AnQiCMS cannot find a template file that matches the specific ID naming convention, it will fall back to using the default general template for the content type (such as article, product, category, single page). For example, if it cannot findarticle/123.htmlIt may try to load,article/detail.html(Document details) orarticle/list.html(Category list).
  3. Does this naming convention support all types of content?