As an experienced CMS operation personnel for security, I am well aware of the importance of content structure for website operation.An adaptable and scalable content model is the foundation for personalized content management and meeting specific business needs.The auto CMS performs well in this aspect, allowing us to define content models and fields in detail according to business characteristics, thus ensuring that we can efficiently manage and display various complex business data.

Understand the AnQi CMS content model and its core value

In the AnQi CMS, the content model is the basic framework for organizing and managing website content.It defines what information should be included in specific types of content, such as an article, a product, or an event.The system includes common models such as "Article Model" and "Product Model", which provide a good starting point.However, the strength of Anqi CMS lies in its high degree of customization, allowing us not only to modify these default models but also to create brand new content models to precisely match our unique business needs.This flexibility ensures that the most suitable content organization method can be found for any business, whether it is e-commerce, news information, real estate, or any other field.Content model once set determines the structure of front-end content display and the form style of back-end content input, which is the foundation of website data consistency and manageability.

Custom field: the key to meet specific business data requirements

The general content type is often difficult to meet the complex data storage and display requirements of specific businesses in many cases.For example, a standard content model may only have title, content, and thumbnail fields.但对于一个电商网站,我们需要记录商品的颜色、尺寸、材质、重量、价格、库存等详细规格;对于一个房产网站,则可能需要楼盘名称、户型、面积、售价、所在区域、配套设施等。If these specific fields are missing, we will not be able to effectively store and manage these business data, resulting in incomplete content, difficult retrieval, and also unable to perform personalized display and filtering on the frontend.

Custom fields are born to solve this pain point.It allows us to add any additional information required by our business outside of standard fields.By defining dedicated fields for each business content type, we can ensure that each piece of content carries the most complete and accurate business data.This not only improves the quality of the data itself, but also provides users with richer and more user-friendly information, thereby enhancing the user experience.

How to customize content model fields in AnQi CMS

Customizing content model fields in AnQi CMS is an intuitive and powerful process.We first need to enter the "Content ManagementHere, we can choose to modify the existing "article model" or "product model", or click "add model" to create a new content model.

Whether it is modification or addition, each content model has several core configuration items:

  • Model name: This is the Chinese name displayed in the background of the model and some breadcrumb navigation, convenient for administrators to identify.
  • Model table nameEnglish: This is the table name stored in the database for the custom field data, it must be usedin English lowercase lettersEnglish: To ensure the standardization of data storage.
  • URL aliasEnglish: Used in the pseudo-static rule of{module}call, it also needs to be usedin English lowercase lettersDirectly affects the generation of the front-end URL.
  • Title name:Defined the prompt text for the main title input box when publishing documents, such as 'Product Name' or 'Event Title', to make the content editing process clearer.

The core customization capability is reflected in the "Content Model Custom Fields" section.Here, we can add countless new fields to meet various business data needs.

  • Parameter nameThis is the friendly Chinese name displayed on the background editing interface for the field, such as 'Article Author' or 'Product Color'.
  • Call field:This is the English name used in the template to call the field data, it must bein English lowercase lettersfor exampleauthororcolor.
  • field type:Safe CMS provides a variety of field types to adapt to different data formats:
    • Single Line Text:For short text input, such as author name, brand name, limited to 250 characters.
    • Number:Ensure the input data is pure numbers, suitable for price, inventory, quantity, etc.
    • Multi-line text:适用于需要较长文本描述的字段,如产品详情的简要介绍。
    • Single selection:Provide preset options, the user can only select one, for example, 'Product status: In stock/Presale/Discontinued'.
    • Multiple selection:Provide preset options, users can select multiple, for example, 'Product features: Waterproof/Shockproof/Lightweight'.
    • Drop-down selectionEnglish: Similar to single-choice, but presented in a dropdown menu format, suitable for situations with many options.
  • Is requiredCan set whether this field must be filled in when content is published to ensure the integrity of key business data.
  • Default value:Set an initial value for the field. For selection type fields (single selection, multiple selection, dropdown selection), you needEnter one option per lineThe system will automatically parse it as an option available for selection.

By following these steps, we can create a customized set of fields tailored to any content model, accurately capturing and storing every data point needed for our business.

The operation benefits brought by custom fields and front-end integration

The introduction of custom fields is not only convenient for back-end management, but also a key to improving website operation efficiency and user experience.

Firstly,Data structures and integrity are significantly enhancedThrough mandatory data types and required fields, we ensure the quality and consistency of the content, avoiding various problems caused by inconsistent or missing data formats.

Secondly,Content creation process is clearer and more efficient.The content editor is faced with a form that is highly matched with business logic when publishing content. The meaning of each field is clear and accurate, which greatly reduces misunderstandings and errors, and improves the efficiency of content publishing.

Moreover,The flexibility of front-end display and the search filtering function have been greatly improved。Custom field storage structure, which can be directly called and displayed in front-end templates. For example, we can use the Anqi CMSarchiveDetailtag to call specific fields{{archiveDetail with name="your_custom_field"}}, or througharchiveParamsLabel loops through all custom parameters for dynamic rendering. Moreover, these custom fields can be used as powerful filtering conditions, combinedarchiveFiltersTags on the list page implement complex search and filter functions, allowing users to quickly find target content based on their needs, such as filtering products by color, size, or price range.

This deep customization capability makes the Anqi CMS a truly adaptable content management system for various business scenarios, helping us better organize, present, and market our content.

Frequently Asked Questions

问:我可以在内容模型中添加无限数量的自定义字段吗?

答:From a technical perspective, there is no strict limit on the number of custom fields in the security CMS, and you can add the fields you need according to your actual business requirements.However, in order to maintain system performance and the efficiency of database management, it is recommended that you reasonably plan the number of fields and avoid adding unnecessary fields.Too many fields may slightly affect the efficiency of data querying and storage.

问:自定义字段创建后,在前端模板中如何调用和展示它们?

答:Custom fields can be accessed on the document detail page byarchiveDetailcalling tags directly, for example, if you create a custom field named “author”, you can use{% archiveDetail with name="author" %}Get its value. In addition, you can also usearchiveParamsLabel to iterate over all custom parameters of the document, suitable for fields with unknown field names or when dynamic display of all additional information is needed, it will return a list containing the field names (Name)and field value(Value)of the object array.

Q: What impact will it have if I modify the name of the 'Called Field' of the custom field?