How to manage document categories in AnQiCMS and how to set custom fields for categories?

Calendar 👁️ 62

As a website operator who deeply understands the operation of AnQiCMS, I am well aware of the importance of content organization and personalized display in attracting and retaining users.In AnQiCMS, the management of document categories and the setting of custom fields are the core links to achieve this goal.A good classification structure can help users quickly find the information they need, and flexible custom fields make the content display more in-depth and diverse.

Document category management: Build a clear content structure

In AnQiCMS, document classification is the foundation of website content organization.It not only determines the attribution of the content, but is also the key carrier for content models and custom field applications.By classifying and managing, we can build a clear and logical content architecture for the website, where any type of information, whether articles, products, or any other kind, can find its accurate location.

When you create or edit document categories in the background, the first task is to select the document model it belongs to.This is crucial because once the category is created and bound to a document model, the model cannot be changed anymore.This means that all content under a category will follow the field specifications of its associated document model.For example, if you select the "Article Model" for the "News Center" category, then all news content under this category will have the fields defined by the article model, such as title, content, publishing time, etc.Similarly, if the 'Product Display' category is selected as 'Product Model', then the products under it will have unique fields such as product name, price, inventory, etc.

On the category settings page, you can configure many options that help with content organization and front-end display.The category name is the key identifier displayed on the front end, and the category introduction can be used as the description information in TDK (Title, Description, Keywords), helping with SEO optimization.In addition to this basic information, you can also adjust the display order of categories to prioritize important or popular categories.On SEO, the system provides SEO title and keyword settings, allowing you to customize more search engine friendly metadata for each category.The custom URL feature provides you with greater flexibility, allowing you to customize the URL paths of category pages according to your business needs, which can further enhance your SEO performance.

To enrich the visual presentation of the category page, AnQiCMS also supports setting Banner images and thumbnails.You can upload multiple Banner images to achieve a carousel effect, and you can also set a representative thumbnail for the category to be displayed in the list or navigation.In addition, the category content field allows you to add detailed descriptions or explanations for the category page, which is particularly useful in scenarios where a deep elaboration of the category is required.The category template setting feature allows you to apply unique page layouts to different categories, for example, you can specify a dedicated template for file downloads for the “Download Center” category to meet its specific functional requirements.Further, you can choose whether to apply the category template to its subcategories, achieving inheritance or independent configuration.

Flexible setting and application of classified custom fields

The custom field of the category is not set separately on the category editing page, but is managed uniformly through the associated "content model".This design approach ensures that all categories and documents under the content model can share a standardized data structure, improving the maintainability and scalability of the system.

To set custom fields for categories, you need to first enter the 'Content Model' management interface in the background.AnQiCMS has built-in 'Article Model' and 'Product Model' two common models, and the system also supports you to create a new custom model.On the content model editing interface, you can add exclusive custom fields for the model.Each custom field contains several core configuration items:

First is the "parameter name", which is the Chinese display name of the field on the back-end management interface, such as "article author", "product series", etc., convenient for operation personnel to understand and fill in.

Next is the 'Field Name', which is the actual name of the field stored in the database and also the identifier used to call the field in the front-end template, for exampleauthororproduct_series. Suggest using concise and clear letters.

The selection of 'field type' is followed, AnQiCMS provides a variety of flexible field types to meet different data storage needs.This includes 'single-line text' for short text input, such as author name;“Numbers” are used for numeric data, such as inventory;“Multi-line text” is used for long text input, such as detailed description;and options such as 'single choice', 'multiple choice', and 'drop-down choice' etc., which are used to define preset option data, such as product color, size, etc.For the selection field, you need to enter all the optional items line by line in the 'Default Value'.

The setting of "whether mandatory" determines whether the field must be filled in when publishing content or editing categories. A reasonable setting of mandatory items helps ensure the completeness and standardization of content.

In this way, you can define fields such as "source", "editor in charge", etc. for the article model, and define fields such as "brand", "model", "material", etc. for the product model.When these models are bound to categories, these custom fields will automatically appear on the category or document editing page for you to fill in and manage.

When calling these custom fields in the front-end template, it is usually usedcategoryDetailtags. If you want to display a specific custom field value, you can use it directly{% categoryDetail with name="自定义字段名" %}The way. For example, if you define a named category modelbanner_descriptioncustom field to store the description text of a Banner, then you can pass it through the template.{% categoryDetail with name="banner_description" %}Get and display its content. For some custom fields that need to be displayed in a loop, such as custom image group fieldscatimagesYou can combine withcategoryDetailandforLoop to output one by one. This flexible calling method allows you to present the content of custom fields accurately at various corners of the page according to the design requirements of the website.

By fine management of document classification and flexible configuration of custom fields, AnQiCMS empowers operators to build a website with strict structure, rich content, and personalized features, thereby better serving target users and achieving the operational goals of the website.


Frequently Asked Questions (FAQ)

1. Can a category be changed to a different content model after it has been created and associated with a content model?Cannot. Once bound in AnQiCMS, the category and content model cannot be changed.This is to ensure the uniformity of the content data structure and the stability of the system.If you really need to change, it is recommended to create a new category and associate the required content model.

2. I added custom fields to the content model, why don't I see these fields on the category editing page?Make sure the custom field you add is for the "category" rather than just for the "document".In the content model, the custom field settings area clearly distinguishes whether it is applied to documents (archive) or categories (category).If you add fields applied to the document to the model, they will appear on the document editing page and will not be displayed on the category editing page.

How to loop through all custom fields of a category in a frontend template instead of calling them individually?You can use it to{% categoryDetail extras with name="Extra" %}The way to get an array or map (depending on your configuration) that contains all custom fields, then use{% for field in extras %}Loop throughfield.Name(field name) andfield.ValueThis field value is displayed. This method is especially suitable for scenarios with a large number of custom fields or when dynamic rendering in templates is required.

Related articles

How to add documents and set recommended attributes, SEO titles, and scheduled publishing in AnQiCMS?

As a professional who deeply understands the operation of AnQiCMS, I know that efficient content publishing and fine SEO optimization are the key to the success of the website.AnQiCMS provides intuitive and powerful tools to help us easily manage website content.This article will provide a detailed explanation of how to add new documents in AnQiCMS, focusing on how to set recommended properties, SEO titles, and scheduled publishing features to ensure your content reaches the target audience accurately and achieves better search engine performance.

2025-11-06

How does AnQiCMS implement multi-level category nesting calls and document list display?

In the operation practice of AnQiCMS, flexible content organization and presentation is the key to attracting and retaining users.The nested call of multi-level classification and the dynamic display of document lists is the core embodiment of AnQiCMS giving operation personnel strong content management capabilities.By skillfully applying system template tags, we can not only build a clear website structure but also present content accurately according to the reader's needs.

2025-11-06

How to perform conditional judgment (if-else) and loop traversal (for) in AnQiCMS templates?

AnQiCMS (AnQiCMS) is an efficient and customizable content management system. Its template engine design philosophy is to simplify the complexity of content presentation, allowing website operators to focus on content organization and optimization.In the daily operation of websites, we often need to display content based on different conditions, or iterate through list data for dynamic rendering.AnQi CMS provides intuitive and powerful template tags, the most basic and core of which are conditional judgment (`if-else`) and loop traversal (`for`) tags.

2025-11-06

How to include common code snippets like header and footer in AnQiCMS templates?

As an experienced AnQiCMS website operator, I am well aware of the importance of website template efficiency and maintainability for daily work.A well-designed template structure that ensures consistency in the brand image of the website, improves user experience, and significantly reduces the cost of content updates and website maintenance.In AnQiCMS, reasonably introducing common code snippets, such as the website header and footer, is the key to achieving this goal.

2025-11-06

How to perform batch keyword replacement operations for documents in AnQiCMS backend?

As a senior practitioner who is deeply engaged in CMS content operation for enterprise safety, I know how crucial it is to efficiently update and maintain content in daily website management.AnQi CMS is not only favored for its simple and efficient architecture, but also for its powerful feature set, becoming a powerful assistant for us to improve operational efficiency.Among them, the document batch keyword replacement function is particularly prominent, which can help us unify the correction of content, ensure the timeliness and accuracy of information, and greatly reduce the burden of manual editing.

2025-11-06

What types of custom fields are supported in the AnQiCMS content model, and how do you add them?

In the operation practice of AnQi CMS, the flexible application of content models and custom fields is the key to improving website content management efficiency and achieving personalized display.As a website operator deeply familiar with AnQiCMS features, I will elaborate on the types of custom fields supported in the content model and their addition methods, helping you fully tap into the potential of AnQiCMS. AnQi CMS is dedicated to providing highly customizable content management solutions, among which 'flexible content model' is one of its core strengths.

2025-11-06

How to create, manage and call document tags in AnQiCMS

As a senior website operations manager for AnQi CMS, I am well aware of the importance of tags in content management and user experience.Labels can not only help us better organize content, improve the SEO performance of the website, but also guide users to discover more interesting information.I will give a detailed introduction on how to create, manage and call document tags in AnQiCMS to help you operate your website.

2025-11-06

How to upload and categorize images and videos in AnQiCMS page resource management?

As a long-term website operator deeply rooted in the AnQiCMS platform, I fully understand the importance of high-quality content and efficient management for the success of the website.In AnQiCMS, properly manage your image and video resources, not only can it make your content more colorful and rich, but also greatly improve the operation efficiency.Next, I will introduce to you in detail how to upload and categorize your images and videos in the page resource management module of AnQiCMS.

2025-11-06