How to specify the content model for a specific category and affect the display of its documents?

Calendar 👁️ 68

AnQiCMS offers excellent flexibility in content management, with the core being the close integration of content models and categories.Understanding how to specify the content model for a specific category and thereby influence the display of its documents is the key to efficient website operation.This can not only organize your website content neatly, but also diversify the front-end display methods to meet different business needs.

Understanding the relationship between content models and categories

Firstly, let us clarify the concepts of "content model" and "category" in AnQiCMS.The content model can be considered as the "skeleton" or "structure definition" of the content, which allows you to customize the fields of the content according to business requirements, for example, an "article model" may contain title, author, content, publication date, etc., while a "product model" may have product name, price, inventory, product parameters, etc.By customizing the content model, it can ensure the structured storage of content.

Categories are used to organize and classify content into a hierarchical structure. It brings together documents with similar topics or properties.In AnQiCMS, after a category is created, it must specify the content model it belongs to, and once specified, this content model is fixed and cannot be changed.This means that at the initial stage of creating a category, you have already determined the content structure that all documents under this category and its subcategories will follow.This design concept ensures consistency of content and also provides a foundation for the differentiation of front-end display.

How to specify the content model for a category

In the AnQiCMS backend, the operation process of specifying the content model for categories is very intuitive.When you enter the "Content Management" under the "Document Category" feature, whether you are adding a new top-level category or editing an existing category, the system will provide options for you to select its "Document Model".

The specific operation is: When creating a new top-level category, you will see a dropdown menu that lists all defined content models (such as the default 'Article Model' and 'Product Model', as well as any custom models).You just need to select a model that is most suitable for the classification content attribute from it.Once confirmed and saved, this category and all future subcategories added will be automatically bound to this content model, and document entry and management under this model will be based on this model.

How the content model affects document entry

The binding of categories and content models directly affects the document entry experience.When you select a category bound to a specific content model to add a new document, AnQiCMS's document editing interface will automatically load the fields preset by the content model.

For example, if you select a category bound to a "product model", the document editing interface will automatically display the "product name" (corresponding to the title field of the content model), "price", "inventory", and other product-specific fields.In addition, if other fields such as "product model", "color", "material", etc. are customized for the "content model" product model, these custom fields will also be displayed in the "other parameters" collapse box in the document editing interface, for you to fill in the corresponding information.This intelligent field loading mechanism greatly improves the efficiency and accuracy of content entry, ensuring that each document follows the preset structure.

How the content model affects the display of documents (template level)

The association of categories and content models will ultimately be reflected in the document display on the website's frontend.AnQiCMS allows you to precisely control the display style of documents for different content models through a flexible template mechanism.

First, AnQiCMS follows a set of default template naming conventions. For example, if your content model table name isarticlethen the system will try to findarticle/list.htmlAs the default template for the model classification list page,article/detail.htmlAs the default template for the document detail page below. Similarly, if it isproducta model, it will correspond toproduct/list.htmlandproduct/detail.htmlThis means that even without any additional configuration, AnQiCMS can automatically match and load the corresponding general template according to the content model.

However, the strength of AnQiCMS lies in its high degree of customization. You can customize templates at multiple levels:

  1. Category customization template:In the document classification editing interface, you can specify a "category template" and a "document template" for a specific category.

    • category templateIt will affect the list page layout of the category itself, for example, you can make the list page of the "News Center" category and the list page of the "Product Exhibition" category have different styles.
    • Document TemplateIt will affect the layout of the detail pages of all documents in this category. For example, you can specify that all documents in the "Technical Articles" category use a template with code highlighting, while documents in the "Company News" category use a simple template.You can also check the 'Apply to subcategories' option, so that the lower-level categories will automatically inherit this setting to avoid duplicate configuration.
  2. Document-level custom template:For individual documents, if you want it to have a unique display style, you can set the "document template" in the "publish document" interface to achieve the most granular personalized display.

  3. Using template tags to display content model fields:This is the core embodiment of the flexibility of AnQiCMS templates. AnQiCMS provides rich template tags, allowing you to accurately call various data from the content model, including those custom fields:

    • By{% archiveDetail with name="字段名称" %}The tag, which can be directly accessed on the document detail page to obtain any field value of the document, including any custom fields you define in the content model. For example, on a product detail page, you can call the product model like this:{% archiveDetail with name="productModel" %}.
    • For those parameters that are not fixed in number or need to be dynamically displayed, you can use{% archiveParams params %}Label to iterate over all custom parameters of the current document and display their names and values in a loop. This is particularly useful when displaying product specifications or additional information in articles. Code example as follows:
      
      {% archiveParams params %}
      {% for item in params %}
          <div>
              <span>{{item.Name}}:</span>
              <span>{{item.Value}}</span>
          </div>
      {% endfor %}
      {% endarchiveParams %}
      
    • Other sucharchiveList(Document list) ,categoryDetail(Category details) tags can also retrieve and display basic data related to the model.

By closely integrating the content model with categories and utilizing multi-level template customization and powerful template tags, AnQiCMS makes website content management highly structured and easy to customize.Whether it is to create product lists in bulk, publish professional articles, or display corporate news, it can ensure the consistency of data and the diversity of display.This flexible mechanism not only improves the efficiency of content operation, but also provides a solid foundation for personalized design on the website front-end, thereby better meeting user needs and search engine optimization (SEO).

Frequently Asked Questions (FAQ)

  1. Q: Can I change the content model belonging to a category after creating it?A: Cannot. Once a content model is specified for a category and saved, the binding relationship is fixed and cannot be modified in the background.Therefore, when creating categories, please be sure to carefully select the appropriate content model.

  2. Q: If I have not specified a custom template for a category or document, which template will AnQiCMS use to display the content?A: If no custom template is specified, AnQiCMS will automatically search for the default template file based on the table name of the content model. For example, if the content model table name isarticleThe system will default to usingarticle/list.htmlAs the list page template,article/detail.htmlAs the detail page template. This default mechanism ensures that the content can be displayed normally even if no personalized settings are made.

  3. Q: Can I display content from different content models on the same page?A: Of course you can. The template tag design of AnQiCMS allows you to specifymoduleIdA parameter that can flexibly call a document list or details from different content models. For example, in a homepage template, you can use{% archiveList archives with moduleId="1" %}Call the article list, and then use{% archiveList products with moduleId="2" %}Call product list, to achieve a mixed display of content.

Related articles

How to insert images, videos, and code blocks in the content editor to enrich the display?

In today's era where content is king, an excellent article is not just a pile of words, but also needs to be illustrated with pictures and text, dynamic and static, even presented clearly with code, in order to better attract readers' attention and convey effective information.AnQi CMS knows this, therefore it has integrated a variety of practical functions into the content editor, allowing content creators to easily insert images, videos, and code blocks, making the content more rich and vivid.Next, we will delve into how to巧妙运用 these tools in the Anqi CMS content editor, making your articles come alive with new vitality.### Insert a beautiful image

2025-11-08

How can AnQi CMS automatically generate article summaries to optimize list content display?

In website operation, how to make the content list page attractive to user clicks and help search engines better understand the page content is a topic that needs continuous optimization.Among them, the quality of the display of the article summary plays a key role.AnQiCMS provides an efficient solution in content management, especially in the automatic generation and optimization display of article summaries, which provides great convenience for content operators.Why is the article summary crucial in the display of content lists?Imagine when a user visits a website's blog or product list page

2025-11-08

How to automatically extract keywords from the article content for SEO display?

In today's highly competitive online environment, content operators are well aware of the importance of keywords for website SEO.They are not only the bridge for search engines to understand the content of your website, but also the entry point for users to find your information.However, manually screening and extracting keywords from each article is undoubtedly a time-consuming and labor-intensive task.Is there a more intelligent and automated way to handle this problem?AnQiCMS (AnQiCMS) deeply understands the pain points of content operators, integrating SEO optimization deeply into the system design.It provides a series of powerful SEO tools

2025-11-08

How to add recommended attributes to articles, products, and display them in front-end categories?

In content operation, how to effectively highlight important information so that users can find the core content at a glance, which is the key to improving the website effect.AnQiCMS (AnQiCMS) provides a flexible recommendation feature that allows you to easily mark the importance of articles, products, or other content and display them on the website front-end as needed.This article will introduce in detail how to add these recommended attributes to the content in the background, as well as how to classify them in the front-end template.--- ## Use Anq CMS recommended attributes to make your content shine on the front page In content management and presentation

2025-11-08

How to display recommended attributes of documents (such as headlines, sliders) on the website front-end?

In content operation, highlighting important or recommended content in an eye-catching way is the key to improving user experience and the efficiency of content reach.AnQiCMS (AnQiCMS) offers a powerful 'recommendation attribute' feature that allows you to easily mark and manage different types of featured content, such as setting it as a headline article, slideshow display, or other specific recommendations.This article will introduce how to effectively present these recommended attributes of documents on the front page of Anqi CMS website.--- ### One, understand the recommended document properties of Anqi CMS First

2025-11-08

How to batch update content in the background to quickly adjust the display results of the website?

With the explosive growth of internet content, the management and update efficiency of website content has become a key to operational success.For websites with strong dynamics and large content volume, manual editing line by line is not only time-consuming and labor-intensive, but may also affect the overall performance of the website due to operational errors.AnQiCMS (AnQiCMS) understands the challenges faced by operators, providing a powerful batch update feature that makes the quick adjustment and display optimization of website content more efficient than ever.### One, Core Tool: Full Station Content Replacement and Keyword Management When the website brand name changes, product links are updated

2025-11-08

How to use the anti-crawling feature to protect the display integrity of original content?

In the era of the explosion of digital content, the value of original content is increasingly prominent.For website operators who have invested a lot of effort in creating websites, how to effectively protect the display integrity of these original contents and avoid malicious collection and plagiarism has become an important issue.AnQiCMS (AnQiCMS) is an efficient and secure website building tool that is built with powerful anti-crawling functions, helping us better maintain the originality of our content.Why Original Content Protection is Crucial?Original content is the core asset of a website, it is not only the key to attracting users and enhancing brand influence

2025-11-08

How to set user group permissions to control access and display specific content for different users?

In website operation, providing differentiated content access permissions and display effects for different users is the key to improving user experience, achieving content monetization, and even improving internal management efficiency.The powerful user group management function of AnQiCMS is exactly designed to solve this pain point, it allows us to flexibly divide user groups and finely control the content they can see and operate. ### Understanding AnQiCMS User Group Management In AnQiCMS, a user group can be understood as a tag for classifying website visitors. Each tag is associated with a set of predefined permissions. For example

2025-11-08