In website content management, maintaining the consistency of page style is crucial for improving user experience and brand image.For websites with multi-level categories, how to efficiently manage the display styles of these category pages is a concern for many content operators.AnQiCMS (AnQiCMS) provides very practical functions in this regard, which can help us easily achieve a unified display style for subcategory categories.

Understanding the importance of category template and subcategory inheritance

In Anqi CMS, the 'category template' refers to the template file used to define the layout and style of the content list page for a specific category.When we create many categories and subcategories for a website, if each category needs to be designed with an independent template, it will be a huge amount of work.It is more important that setting manually one by one is not only inefficient but may also cause subtle style differences between different subcategories, affecting the overall aesthetics and user experience of the website.

Users usually expect to experience consistent visual navigation and content presentation styles when browsing different categories of a website.This consistency can not only enhance users' familiarity and reduce the cost of learning, but also help establish a professional brand image.Therefore, it is particularly important to have a mechanism that allows the template settings of the parent category to be automatically applied to its subordinate subcategories.

The setting and inheritance mechanism of AnQi CMS category template

AnQi CMS fully considers this need and provides a convenient template inheritance option in its category management function. We can find and configure it by the following steps:

First, log in to the Anqi CMS backend, go to [Content Management] -> [Document Category]. Here, we can see the structure of all the website categories.

When we select a specific category to【edit】or【add】, in the page's【other parameters】section, we will find an option named【category template】. Here we can specify a dedicated template file for the current category, for example, if it is a product list category, we may wish to useproduct/list.htmlor more specificallyproduct/list-new-products.htmlsuch a template to display its content.

The core key to this problem lies in an important option below the [Classification Template]:[Apply to Subcategories].

The [Category Template] set for a single category in AnQi CMS by default will not automatically inherit to its subordinate subcategories.This means that if you do not check this option, each subcategory will need to specify a template manually, otherwise, the system default template will be used.

But, the system kindly provided a checkbox that we can enable once[Apply to Subcategories]This option, then the list template used by the current parent category (such as the one we set for "Product Center")product/list-main.html) will automatically apply to all of its direct subcategories and deeper sub-subcategories.This means that regardless of how many subcategories there are under the "Product Center", such as "Smartphones", "Laptops", "Accessories", and so on, they will all share the same list display layout and style unless a subcategory is specifically designated with a different template to override the inheritance.

Flexible use of category template inheritance to achieve a unified style

This inheritance mechanism brings about an obvious improvement in operational efficiency.Imagine that your website has multiple product lines, and each product line's subcategory needs a unified product list display style.In the past, you may have needed to set up a template for each subcategory separately, which was not only time-consuming and labor-intensive, but also required individual modifications whenever styles needed to be adjusted.Now, just check the [Apply to child categories] option in the parent product line category (for example, 'Electronics') and specify it properlyproduct/list-electronics.htmlThe template and all its subcategories (such as "phone", "tablet", "wearable devices") instantly gained a unified style, greatly reducing the repetitive workload.

This method also has the advantage of:

  • Maintain consistencyEnsure that the entire website maintains consistent visual appeal and interaction logic when users browse different categories of content.
  • improve efficiency: For websites with a large number of subcategories, only the parent category template and inheritance settings need to be maintained, greatly simplifying daily operation and update work.
  • Reduce maintenance costsWhen you need to adjust the style, just modify the template file of the parent category, and all the child categories inheriting it will be updated synchronously.
  • Local flexibility: Although most subcategories can inherit the parent template, if a particular subcategory indeed needs a unique display style, we can still specify a template for it separately. This will override the inherited settings, maintaining the flexibility of local customization.

Furthermore, it is worth mentioning that, in addition to the inheritance of the category list template, Anqi CMS also provides an independent [Document Template] option in the category settings. This option is used to specify the display template for all document detail pages under the category, which can also be inherited from the parent category to the child category, further unifying the style of content detail pages, for example, so that all product detail pages useproduct/detail.htmlTemplate.

Overview of Operation Steps

Summarize, to implement the inheritance of classification templates in Anqi CMS for unified display style, it is generally necessary to go through the following steps:

  1. In AnQi CMS backend, go to [Content Management] -> [Document Category].
  2. Select or create a parent category that you want to set the template for and have its subcategories inherit.
  3. In the [Other Parameters] section of the category editing page, find the [Category Template] option, enter the filename of the template you want to use (for example:article/list-special.html). Make sure the template file exists.
  4. Tick the box in front of 【Whether to apply to subcategories】immediately.
  5. Click 【OK】or 【Save】to set the category.
  6. (Optional) If you need to unify the style of the document detail page, you can set the [Document Template] and check the inheritance option below it.

By using the clever category template inheritance function of AnQi CMS, we are able to greatly improve the efficiency and flexibility of content management while maintaining the overall style consistency of the website.This allows us to focus more on the creation and optimization of the content itself, without spending too much energy on repetitive style settings.


Frequently Asked Questions (FAQ)

1. How to operate if the child category needs an independent display style and does not want to inherit the parent category template?If a subcategory indeed needs a different display style from the parent category, you just need to enter the editing page of the subcategory, and separately specify a dedicated template file for its [category template].This separate setting will override the inheritance rules of the parent category, ensuring that the child category can display in its unique style.

2. Does the template inheritance of the parent category only apply to list pages? Will the template of the document detail page also inherit?In AnQi CMS, there are two independent template options: [Category Template] and [Document Template].The parent category's [Category Template] inherits mainly for the list page display style of its child categories.And the document template is used to specify the display template for all document detail pages in the category, it also has an independent option for “whether to apply to subcategories”, if checked, it also supports inheritance to subcategories, thereby unify the style of content detail pages.

3. I have set up and saved the category template inheritance, but the front page did not take effect. What could be the reason?In this case, please first check whether the template filename you have entered is correct, and make sure that the template file actually exists in your template design package.Next, confirm that the [Apply to child categories] option of the parent category has been correctly checked and saved.Finally, AnQi CMS sometimes needs to clear the cache for new settings to take effect. You can try clicking the [Update Cache] feature in the background, or manually clear the browser cache and visit again.