In website operation, we often encounter such needs: some articles or categories, due to the particularity of their content or marketing needs, we hope to give them a completely different display style from other parts of the website.This personalized display requirement is particularly important in today's increasingly rich content.So does AnQiCMS support the use of unique display templates for specific articles or categories?The answer is affirmative, and it provides powerful and flexible features to support you in achieving this goal.

Why do I need a dedicated template?

Imagine, you might have a new product launch special page, hoping to have a unique visual impact to attract users;Or a specific product series, which needs to focus more on image display rather than text description.Perhaps you would like to present an important announcement in a prominent way, while keeping other ordinary information concise.Exclusive templates can help us better focus on the key points of content, improve user experience, enhance brand image, and even greatly benefit the improvement of conversion rates.AnQiCMS fully understands these requirements and incorporates them into the core design of the system.

The flexible template customization path of AnQiCMS

AnQiCMS was designed from the beginning to provide an efficient, customizable, and scalable solution.One of its core advantages is the "flexible content model", which lays the foundation for us to achieve personalized content display.By using the various built-in functions of the system, you can easily specify unique display methods for different content types.As early as the AnQiCMS v2.0.0-alpha7 version, the system officially introduced the features of custom categories, articles, and page templates, making this personalization accessible.

Customize templates for single articles or single pages

Customizing templates for individual content is very intuitive and convenient. When you edit or publish a new article in the "Content Management" backend, you will find a field named "Document Template", which is usually located in the collapsed area of "Other Parameters".Here, you can directly enter the template filename you designed for this specific article, for example, if you designed a unique template for a download article,download.htmlTemplate, just fill in heredownload.htmlIt can. When the system renders this article, it will give priority to the exclusive template you specify.

Similarly, for the single pages under "Page Resources" (such as "About Us", "Contact Us", etc.), there will also be a similar "Single Page Template" option when editing.The operation method is consistent, you just need to enter the corresponding template file name, and your single page will have a unique layout and style.

Custom template for a specific category

If you want all the list pages under a specific category to use a specific layout, AnQiCMS also provides a convenient setting.When editing a category in the "Content Management" "Document Category", you will see an option named "Category Template".Enter the name of the template file you have designed for the category list page, for examplelist-product.htmlThen the list page of this category will use this exclusive template.

It is especially worth mentioning that this setting also has an option for whether it should be applied to subcategories.If you check this option, then the list page of all subcategories under this category will automatically use the custom template you set, which undoubtedly provides great convenience for maintaining the consistency of the style of specific content modules in a large website.

Let the articles in the category also have an exclusive template.

In addition to setting a template for the category list page, AnQiCMS also allows you to specify a default detail page template for all articles under the category level.On the editing page of 'Document Classification', in addition to 'Category Template', there is also a setting item named 'Document Template'.The template filename entered here will be used as the default detail page template for all articles in this category.This way, you don't have to set each article individually, ensuring that all detail pages under a specific category present a unified style, greatly improving management efficiency.

The placement and naming convention of template files.

Where should these custom template files be placed and what should they be named? AnQiCMS template files are stored uniformly in the system's/templatethe directory, and.htmlAs a suffix. Each independent template usually has its own subdirectory.When you specify a custom template name in the background, just make sure that the file exists in the currently enabled template directory.

For example, if the current theme directory you are using isdefaultthen your custom template file may be located/template/default/article/download.html. In the background 'Document Template' field, you just need to fill inarticle/download.htmlJust do it.

In addition, AnQiCMS also supports some default naming conventions, such as:

  • Default custom template for document details:{模型table}/{文档id}.html(For example)article/123.html)
  • Default custom template for document list:{模型table}/list-{分类id}.html(For example)article/list-45.html)
  • Default custom template for single page:page/{单页面id}.html(For example)page/6.html)

This means that even without manual setup through the backend, as long as your template file follows these conventions, the system can automatically identify and apply them, further simplifying management.

Summary

In summary, AnQiCMS provides meticulous consideration and strong support for customizing content display templates. Whether it is for a single article, an entire category, or all articles under a category, you can find the corresponding settings options.