How to customize fields in AnqiCMS content model and set their types and default values?

Calendar 👁️ 71

As an experienced AnQi CMS website operations personnel, I deeply understand the importance of the flexibility of the content model for the efficiency of website operations and the personalized display of content.The powerful content model customization feature of AnQi CMS is the key reason why it has become the preferred tool for small and medium-sized enterprises and content operation teams.Today, let's discuss in detail how to customize the content model field in AnqiCMS and set its type and default value.

Understand the content model of AnqiCMS

In Anqi CMS, the content model is the foundation for defining the structure of various content (such as articles, products, events, etc.).The system is pre-installed with the 'Article Model' and 'Product Model', which provide a set of basic content fields.However, different business scenarios often require more specific and professional fields to carry information.For example, a e-commerce website's product may require fields such as 'brand', 'color', 'size', 'stock unit', etc., and these are not covered by the general model.By customizing the content model fields, we can add unique properties to each content model according to actual business needs, realizing highly personalized content management.

Enter the content model custom field settings

To customize the content model field, you need to log in to the AnqiCMS backend management interface.In the left navigation bar, find the 'Content Management' module and then click on the 'Content Model'.Here, you can see the built-in models of the system as well as the custom models you may have created.Select the specific content model you want to add or modify (whether built-in or custom), click the edit button to enter the detail page.

In the editing interface of the content model, you will see a special area for 'custom fields of content model'.This is the area where we flex our muscles, adding more details to the content.Click the "Add Field" button to open a form that allows you to define the properties of the new field.

Define the properties of custom fields

Each custom field needs to be carefully configured with its properties to ensure it can store and display content correctly.

FirstlyParameter NameThis is the Chinese name displayed on the background management interface, which is convenient for you and your team members to understand its purpose. A clear parameter name can greatly improve the convenience of background operations.

Next isField invocationThis is the template and actual field identifier used in the database.The AnQi CMS recommends using lowercase English letters as call fields to ensure accuracy and stability in internal system recognition and frontend template calls.For example, you can set the call field for "Article Author" toauthor.

The third isField typeThis is the core attribute of a custom field, which determines the type of data it can store and its behavior in the background. Anqi CMS provides a variety of field types for you to choose from to meet different content needs:

  • Single-line text: Suitable for short text input, such as article author name, article source, product SKU, etc., which is usually limited to 250 characters to avoid long input content.
  • NumberEnsure that the input content is in numeric format. This type is suitable for fields that require numerical calculations or only allow numeric input, such as product inventory, product prices, reading counts, etc.
  • Multi-line text: It is used to carry long text content, such as product descriptions, activity rules, user reviews, etc. It provides a larger text input area, allowing for richer content input.
  • Single choice:Provide predefined options for users to make single selections. This type is very suitable for scenarios that require standardized options, such as products' 'color', 'size', or articles' 'difficulty level'.The specific content of the option will be defined by the subsequent "default value" field.
  • Multiple selections: Similar to single selection, but allows users to select one or more from predefined options.For example, a product may have multiple 'feature' tags, and users can select several of them.The option content is also set in the "default value".
  • Drop-down selection: Single selection options are presented in the form of a dropdown menu. When there are many options, it can effectively save space on the backend interface. The content of the options also needs to be defined in the "default value".

The fourth property isMandatory?You can decide whether to fill in this field when publishing content according to your business needs.If a field is crucial for the integrity of the content, such as product price or article title, you can check this option, and the system will perform a check at the time of content publication to avoid missing key information.

Finally isDefault valueThis is a very practical feature that provides default values for new content, reducing the manual input workload.For fields of the 'Single-line text', 'Number', and 'Multi-line text' types, you can directly enter a default text or number here.It is noteworthy that for the three field types of 'Single selection', 'Multiple selection', and 'Dropdown selection', each line in the 'Default value' field will be treated as a separate option.For example, you want a dropdown menu to have "Option A", "Option B", and "Option C", just enter an option per line in the default value input box, and the system will automatically parse one option per line.If a custom field has a default value and you want it to be displayed as the default value when called from the front end, then when publishing content, you just need to leave the field blank, and the system will automatically assign the default value to the field.

By following these steps, you can flexibly customize the fields of the AnQi CMS content model and set appropriate types and default values.This high degree of customization allows AnqiCMS to adapt to various complex business scenarios, helping you manage and display website content more efficiently, thereby attracting and retaining users better.


Frequently Asked Questions (FAQ)

1. Can I delete the built-in "article model" or "product model" of AnqiCMS?The 'Article Model' and 'Product Model' built into the Anqi CMS system can be modified in their fields, but cannot be directly deleted.This is to ensure the core functions and stability of the system's data structure.However, you can customize and create new content models to replace them, and gradually migrate the content to the new models.

2. After creating a custom field, I found that the name of the "invoked field" is incorrect, can I change it?The 'Called field' is a unique identifier directly associated with the database table structure and template call.Once created and put into use, it is generally not recommended to modify it. This may lead to field association errors in published content, and even cause problems at the database level.It is best to delete the field and recreate it if an error is found in the initial creation.If there is already a large amount of data, be sure to back up the data before modification and operate under the guidance of a professional technical personnel.

3. How do I call the custom content model field in the frontend template?In AnqiCMS, you can call custom fields through specific template tags. If the 'calling field' of the custom field isauthorThen in the template of the document detail page, you can use{{archive.author}}to directly call its value. For loop output of all custom fields, you can use{% archiveParams params %}Use the tag to get and traverse all fields and their values. For specific usage, please refer to the AnqiCMS template tag document.archiveDetailandarchiveParamsDescription of the tag.

Related articles

How to manage document categories and set exclusive templates in AnqiCMS?

HelloAs a website operator who has been deeply involved in AnQiCMS for many years, I am very clear about the importance of efficient content management for attracting and retaining users.Document classification is not only the skeleton of content, but also the key to user experience and search engine optimization.Today, let's delve deeply into how to manage document categories finely in AnQiCMS and set up exclusive templates for them.

2025-11-06

How to operate the document recycle bin feature in AnqiCMS, and how long is the document retention period?

As a senior security CMS website operator, I am well aware that the core of content management lies in the management of the lifecycle of content, including creation, publication, and even the final deletion and recovery.AnQi CMS fully considered these operational needs from the beginning of its design, integrating a practical document recycle bin function to ensure the flexibility and security of content operations. ### Security CMS Document Recycle Bin Operation Guide In Security CMS, the document recycle bin provides an important content protection mechanism. It does not simply physically delete content, but adopts a "soft delete" strategy.

2025-11-06

How is the document thumbnail and SEO title set and effective in AnqiCMS?

As a website operator proficient in AnQiCMS, I am well aware of the power of content in the digital world and how to attract and retain users through carefully crafted content.In AnQiCMS, document thumbnails and SEO titles are an essential part of the content publishing process. They not only affect the visual presentation of the content but also directly relate to the performance of the content in search engines.Below, I will elaborate on how these two key elements are set and take effect in AnQiCMS.--- ###

2025-11-06

How to specify a custom URL and schedule content publishing in a document?

As a website operator who deeply understands the operation of AnQiCMS, I know the key role of high-quality content and efficient publishing mechanism in attracting and retaining users.In daily work, precise planning of content, control of the timing of release, and the friendliness of URLs are crucial for improving user experience and search engine performance.Below, I will combine the powerful functions of AnQiCMS to elaborately explain how to effectively specify custom URLs and schedule content publishing.

2025-11-06

How to manage and associate documents with tags in AnqiCMS?

As an experienced security CMS website operator, I am well aware of the core value of tags (Tag) in content management and user experience.It is not only an effective supplement to content classification, but also a key tool for connecting related information, enhancing the internal link structure of the website, and optimizing search engine performance.In AnQi CMS, the management of tags and document associations is designed to be intuitive and powerful, aiming to help operators efficiently organize content and enhance the convenience of user discovery.### Role and backend management of tags in AnQi CMS In AnQi CMS, tags are cross-category

2025-11-06

How to manage single page content and image video resources in the AnqiCMS background management?

As a website operator who deeply understands the operation of AnqiCMS, I know that efficient content management and optimization is crucial for attracting and retaining users.AnqiCMS with its concise and efficient architecture provides us with powerful tools to handle all aspects of the website.Today, I will elaborate on how to manage single-page content on the AnqiCMS backend, and effectively utilize images and video resources to enhance the content quality and user experience of your website.### Efficient Management of Single Page Content Single page, such as "About Us", "Contact Information", or "Service Introduction"

2025-11-06

What can be configured in the AnqiCMS global function settings for website basic information and security options?

As an experienced CMS website operation personnel in the security industry, I know that the foundation of a website lies in its perfect basic information configuration and reliable security protection.These global settings not only define the facade and identity of the website, but are also the key to ensuring the safe, stable, and efficient operation of the content.A enterprise CMS provides comprehensive and flexible configuration options, allowing operators to comfortably build and maintain their digital platforms. The detailed explanation of the global function settings of Anqi CMS, where you can configure the basic website information and security options.###

2025-11-06

How to create multi-level menus and customize navigation categories in the website navigation settings?

As a senior website operator, I am well aware of the importance of a clear and efficient website navigation for user experience and Search Engine Optimization (SEO).It is not only a map for users to explore the content of the website, but also a key for search engines to understand the structure of the website.AnQiCMS provides flexible and powerful website navigation settings, allowing us to easily create multi-level menus and customize navigation categories to meet the needs of different business scenarios.

2025-11-06