How can I specify a display template uniformly for all documents under a specific category?

Calendar 👁️ 59

When using AnQiCMS to manage website content, we often encounter the need that all articles, products, or other documents under a specific category should use the same display template uniformly, rather than setting each document separately.This not only ensures the consistency of the website style, but also greatly improves the efficiency of content operation.AnQiCMS understands the pain points of users in this aspect and therefore provides a very flexible and intuitive way to meet this need.

Locate the target category

Firstly, we need to enter the AnQiCMS backend management interface and find the category we want to unify the template for.Generally, this would be located under the "Document Classification" page in the "Content Management" module.Here, you will see all the categories created, which are clearly arranged according to the structure level you set.

Find the target category you want to set in the category list, then click the 'Edit' button next to it to enter the detailed editing page of the category.

Configure the category-specific document template

In the category editing page, scroll down until you see a setting item named "Document Template".This field is used to specify the display template for all documents in the category.

For example, if you have a "Company News" category and you want all the news in this category to use a name callednews_detail.htmlTo display details using a template, just fill in the 'Document Template' field here.news_detail.htmlThe same applies. If your 'Product Display' category needs a specificproduct_display.htmlTemplate, also set accordingly.

It should be specially reminded that the template file name you enter here must exist in the template package you are currently using (located in/template/您的模板目录/If the file does not exist, accessing the documents under the category may cause the page to fail to load.

Flexible application to subcategories

Immediately below the 'Document Template' setting, you will find a very practical option - 'Apply to Subcategories'.

By default, the document template you set for the current category will only take effect on the category itself.If you wish for this template to also be inherited and used by all subcategories under this category, please make sure to check this option.For example, you have set a uniform for the large category of "News Center"news_detail.htmlTemplate, and if you check the 'Apply to subcategories' option, then all the documents under 'News Center', such as 'Industry Dynamics', 'Company Announcements', and so on, will be automatically沿用news_detail.htmlDisplay it. This is very effective for constructing a website structure with a unified brand image or content style.

Save and verify changes.

After completing these settings, don't forget to click the 'Save' button at the bottom of the page to make your changes effective.After saving successfully, to ensure that the template update is immediately reflected on the website front end, we recommend that you go to the "Update Cache" feature in the background and clear the page cache of the website.

Finally, be sure to visit a few documents under this category on the front end to confirm that they are all displayed correctly according to the new template you specified.If everything goes well, then congrats, you have successfully specified a display template for all documents under a specific category!This approach can greatly simplify the content management process, ensure visual consistency of the website, enhance the user browsing experience, and improve your operational efficiency.


Frequently Asked Questions (FAQ)

1. If a document has also set a "document template" on its own editing page, which template will take effect, the unified template set in the category or the template set by the document itself?

In most cases, AnQiCMS follows the logic of 'proximity principle' and 'more specific priority'.This means that if a document specifies a template on its own editing page, then the settings for this single document have a higher priority and will override the template specified uniformly for its category.Only when the document itself has not set a template, the unified template specified in the category will take effect.

2. I should place the custom document template file (such asnews_detail.html) in which position in the website directory?

You need to place the template file you customized in the root directory of the AnQiCMS websitetemplateInside the folder, specifically in the folder of the template theme you are currently using. For example, if your template theme is nameddefault, then the file should be placed in/template/default/In the directory. To organize the structure better, it is usually placedarticle/orproduct/in such subdirectories, for example/template/default/article/news_detail.html.

Can I set a document template uniformly for a category but want some special documents in that category to use a different template? Is it possible?

It is completely possible. As mentioned in the first question, the priority of the template setting for a single document is higher.You just need to edit those special documents, find the 'Document Template' option on the editing page, and specify the required template file name for them separately.These special documents will use their own independent templates, while other documents in the category will continue to use the unified templates set.

Related articles

Can the settings of the category template be inherited by subcategories to unify the display style of subcategories?

It is crucial to maintain the consistency of page style in website content management to enhance user experience and brand image.Especially 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 aspect, which can help us easily achieve the uniformity of the display style of subcategories.Understanding the importance of category templates and subcategory inheritance in Anqi CMS

2025-11-08

How to set a custom template for categories to change the overall display style of the category page?

AnQi CMS provides great flexibility for website content management, and customizing the display style of category pages is a very practical feature.By setting custom templates for different categories, you can easily allow news, products, cases, and other types of category pages to present unique design and content layouts, thereby better meeting users' browsing needs and brand display strategies.Why do you need a custom category template? By default, AnQi CMS uses a generic list template for all categories (usually `{modeltable}/list.html`)

2025-11-08

How to use Markdown formatting in document content and ensure it is correctly rendered as HTML?

AnQi CMS provides flexible content editing methods for content creators, among which the support for Markdown format greatly improves the efficiency and expressiveness of content creation.Understand how to use Markdown correctly in document content and ensure that it is perfectly rendered as HTML on the website front-end is the key to bringing this feature into play. ### Enable and Use Markdown Editor To start using Markdown in AnQiCMS, you first need to make simple configurations in the background.This is usually completed in **Global Settings -> Content Settings**

2025-11-08

How to add multiple Tag tags to documents and associate them for display and filtering on the front end?

In AnQiCMS, adding Tag tags to documents and associating them for display and filtering on the front end is an effective way to enhance the organization of website content and user experience.Tag labels can not only help users find the content they are interested in faster, but also optimize the keyword layout of the website from the SEO level, increasing the exposure of the content.Next, we will discuss in detail how to implement this feature in AnQiCMS. ## One, add Tag label to document in the background Adding a Tag label to the AnQiCMS backend is a straightforward and convenient process. First

2025-11-08

How to display banner carousel images or thumbnails on the category page to enrich the visual effects?

In website operation, the category page is not just a content directory, but also a key entry for users to explore and discover your website's services or products.A beautifully designed, visually rich category page can significantly enhance user experience, inspire their interest, and guide them to explore deeper.AnQiCMS (AnQiCMS) provides flexible and powerful features, allowing you to easily display eye-catching banner carousel images or beautiful thumbnails on the category page, thereby enriching the visual effects and attracting visitors' attention.###

2025-11-08

How can the display content of the document list be dynamically adjusted through filtering conditions?

AnQiCMS (AnQiCMS) provides website operators with powerful content management capabilities, one very practical feature is to dynamically adjust the display content of the document list through filter conditions.This can greatly enhance the user experience, help visitors quickly find the information they need, and also optimize the internal link structure of the website, indirectly helping search engine optimization (SEO).Imagine if your website has rich content, but users can only find specific information through cumbersome pagination or a single keyword search, which is undoubtedly frustrating.And dynamic filtering function

2025-11-08

How does the AnQiCMS recycle bin feature affect the display status and recovery of deleted content?

In the operation of daily websites, content management often comes with the risk of accidental operations, whether it is the accidental deletion of important articles or content that needs to be recalled after publication.A comprehensive content management system should not only provide efficient publishing tools but also have a reliable security mechanism.A safe CMS knows this and therefore provides a thoughtful trash can function, which plays a crucial role in content lifecycle management.### SecureCMS Recycling Station: Safe Harbor When you perform deletion operations on articles, products, pages, and other content in the SecureCMS backend

2025-11-08

How to extend the content model through custom fields and display this additional information on the frontend page?

In AnQi CMS, the presentation of content is not limited to basic elements such as title and body.To meet the diverse content display needs of corporate websites, the system provides powerful content model custom field functions, allowing us to add various exclusive information according to specific business scenarios.This is like customizing a detailed profile for each content type, which is not only clear in backend management but also flexible on the frontend page, greatly enhancing the website's performance and user experience.Why do we need custom fields?

2025-11-08