How to customize fields in the AnQi CMS content model to achieve personalized content input?

Calendar 👁️ 46

As a senior security CMS website operator, I know that content is the cornerstone of the website, and effective content management and personalized presentation are the key to attracting and retaining users.AnQi CMS, with its flexible content model, provides us with powerful customization capabilities, making content input no longer limited by predefined frameworks.Today, we will delve into how to customize the fields of the content model in Anqi CMS to achieve highly personalized content input.

The foundation of flexible content models: custom fields

In Anqi CMS, the content model is the core of defining the structure of specific types of content.The system provides the "article model" and "product model" by default, which include some common fields such as title, content, category, thumbnail, etc.However, in actual operation, our content needs are often more diverse and specific.For example, a product may require specific information such as 'brand', 'model', 'color options', 'stock quantity', etc.;A job posting may require unique fields such as "position salary", "work location", and "education requirements".

At this time, the custom field comes into being. It allows us to add exclusive data input items for each content model, ensuring that each type of content can be constructed in the most accurate and richest way possible.This greatly improves the efficiency of content management and also lays a solid foundation for personalized display on the front end, thus better meeting users' needs for the depth and accuracy of information.

Navigate to the content model management interface

To start customizing fields, we first need to enter the Anqi CMS backend management interface.In the left navigation bar, find and click "Content Management", then select "Content Model".This will list all the content models currently in the system, including built-in models and any custom models we may have already created.

We can choose to modify an existing model, such as a "product model", to add specific fields, or create a brand new content model from scratch to define all its properties.No matter which way, the core operation is to configure the model fields.

Detailed steps for customizing content models and fields

On the content model editing or new page, there are several core areas that we need to pay attention to.

The first is the basic information setting of the model:

  • Model nameThis is the Chinese name displayed in the background and breadcrumb navigation of the model, which should intuitively reflect the content type of the model, such as "Tour route" or "Solution".
  • Model table nameThis is the table name stored in the database for model data, it must be in English lowercase letters. This field is unique and usually not recommended to be changed arbitrarily once set.
  • URL aliasFor use in static rule definition{module}The call, it will be reflected in the URL path of the front-end page, and it is recommended to use lowercase letters in English.
  • Title NameThis setting is very user-friendly, it will replace the common prompt text of "Document Title" when publishing documents.For example, if this is a 'product model', we can set it as 'product name' to make it clear for content editors.

The key area for implementing personalized content input is - 'Custom fields of content model'.Here we can freely add dedicated fields to the current model based on business requirements.

Click "Add field", a form will pop up to configure the detailed properties of each custom field:

  • Parameter NameThis is the Chinese name of the field displayed on the backend editing interface for operators, such as 'Product Price', 'Applicable Industry', 'Article Source', etc.Clear parameter names help content editors accurately understand the field usage.
  • Field invocationThis is the actual field name stored in the database, as well as the unique identifier for data calls in the front-end template. It must use letters, such asprice/industry/source. It is recommended to use camelCase or underscore naming conventions and maintain consistency.
  • Field type: AnQi CMS provides various field types to adapt to different data formats:
    • Single-line text: Suitable for short text input, such as brand names, product models, author names, etc., the length limit is usually within 250 characters.
    • Number:Designed for numeric data, such as price, inventory quantity, reading volume, etc., ensure that the format of the input content is correct.
    • Multi-line textFor scenarios that require input of long text, such as product descriptions, event introductions, and solution overviews.
    • Single choice: Multiple options can be set, but the user can only select one, for example, "Product Status" (new, popular, discontinued).The value is set through the "Default Value" area below, one option per line.
    • Multiple selections: Multiple options can be set, but the user can select one or more options, such as "Product Features" (waterproof, dustproof, shockproof).The option value setting is the same as single selection.
    • Drop-down selectionProvide a dropdown menu for users to select one option, suitable for scenarios with many options and space-saving needs, such as 'Product Color' (Red, Blue, Green, Black).The option value setting method is the same as single selection.
  • Mandatory?: You can specify whether this field is required to be filled in when the content is published. If it is set as required, the system will perform verification when submitted.
  • Default valueSet an initial value for the field. This area is used to enter all available options for fields of single-choice, multiple-choice, and dropdown types. Each option is entered on a separate line.If the field has a default value and is left blank during content editing, the default value will be automatically displayed when the front-end is called.

After configuring all custom fields, save the content model. These new fields will take effect immediately.

Experience personalized input when publishing content.

After the custom field is configured and saved, enter the 'Content Management' module again, select 'Add Document' or edit an existing document.In the document editing interface, when we select a content model category that belongs to a custom field that has been added, these new fields will be displayed in the 'Other Parameters' collapsible area.

Content editors can now accurately fill in product parameters, event details, or other specific information based on these personalized input boxes.This structured input method not only ensures the consistency and integrity of the data, but also greatly reduces the complexity of content entry, ensuring the quality of the content.

Flexibly call custom fields in the front-end template

The value of the custom field ultimately manifests in the dynamic display on the front-end page.AnQi CMS provides powerful and flexible template tags, allowing us to easily call these custom data in the page.

To call the value of a single custom field, we can use{% archiveDetail with name="自定义调用字段" %}tags. For example, if we define a call field for the product model asmaterial(Material), we can call it like this on the product details page:<div>产品材质:{% archiveDetail with name="material" %}</div>.

If we need to dynamically traverse and display all custom fields and their values, especially for product parameter lists and similar scenarios, we can use{% archiveParams params %}Label. It will return an array object containing all custom fields, we can iterate through them.forLoop to display one by one:

{% archiveParams params %}
<div>
    {% for item in params %}
    <div>
        <span>{{item.Name}}:</span>
        <span>{{item.Value}}</span>
    </div>
    {% endfor %}
</div>
{% endarchiveParams %}

In this way, even if the future content model adds new custom fields, the front-end template does not need to be significantly modified, it only needs to republish the content to dynamically display, greatly improving the maintainability and scalability of the template.

Summary

The content model custom field function of AnQi CMS is a direct embodiment of its 'flexible content model' project advantage.It broke the rigid structure of traditional CMS in content structure, giving us the ability to customize the content input interface according to specific business needs.By carefully planning and configuring custom fields, we can achieve more accurate data management, a more efficient content creation process, and a richer variety of front-end content display, ultimately providing users with a more personalized and valuable website experience.


Frequently Asked Questions

Can the custom field be applied to all content models?

Yes, Anqi CMS allows you to add custom fields to the built-in "article model" and "product model", and also create new content models and define exclusive fields for them.Each custom field belongs to a specific content model and does not confuse.

How can you dynamically determine if a custom field exists in a template and display it?

In the front-end template, you can use{% archiveParams params with sorted=false %}Get an unordered map object and then useifstatements to combineinAn operator is used to determine whether a custom field (through its "calling field") exists. For example,{% if 'author' in params %} ... {% endif %}You can determine if there is a custom field named "author". If it exists, then proceed through{{params.author.Value}}Get its value.

If I modify the 'call field' of the custom field, will it affect the existing content?

Modifying the "call field" (i.e., the database field name) of a custom field is a sensitive operation.In most cases, if this field already has data, direct modification will cause the original data to be inaccessible through the new field name, resulting in data loss or display errors.It is recommended to make a data backup before making changes and to avoid modifying the 'call field' that is already in use.If indeed a modification is required, it may be necessary to perform data migration at the database level, mapping data from old fields to new fields, which usually requires the assistance of technical personnel.

Related articles

How to manage and use document tags in Anqi CMS?

Hello!As a senior AnQi CMS website operations personnel, I am very happy to give you an in-depth explanation of how to efficiently manage and use document tags in AnQiCMS.Document tags are not only a powerful supplement to content classification, but also a key tool for improving user experience and search engine optimization.

2025-11-06

How to add, edit, and manage document categories in Anqi CMS?

As an experienced website operator proficient in AnQi CMS, I am well aware that content classification plays a core role in building an efficient and user-friendly website.It not only helps readers find the information they need quickly, but is also an indispensable part of SEO strategy.In Anqi CMS, the management of document categories is intuitive and powerful, allowing you to flexibly organize content according to your business needs. --- ### Efficiently manage your content categories in AnQi CMS: Add, edit, and optimize practices Good content categorization is the foundation of website content management.It is like the index system of a library

2025-11-06

What are the main function modules of the Anqi CMS backend management interface?

As an experienced soldier who deeply understands the operation of AnQiCMS, I know that an efficient and intuitive backend management interface is of great importance for website operation.It is not only the center of content production, but also the command tower for the implementation of operational strategies.The AnQiCMS backend is designed for this purpose, it clearly divides the complex website management work into several core functional modules, aiming to allow operation personnel to handle daily work with ease and focus on the value creation of content.The AnQi CMS backend management interface is mainly divided into ten functional modules, each with its own responsibility

2025-11-06

What are the preset patterns of the Anqi CMS static rules, and how to customize them?

AnQiCMS (AnQiCMS) is an efficient platform focused on enterprise content management, which provides many practical functions in website optimization, among which the setting of pseudostatic rules is a key link to improve the search engine friendliness (SEO) of the website.By reasonable static configuration, the website URL structure can become clearer and more readable, which is helpful for search engine crawling and user memory.### The preset modes of AnQi CMS URL rewriting rules To simplify the configuration work of website administrators, AnQi CMS built-in four commonly used preset modes of URL rewriting rules

2025-11-06

How to manage single pages and page resources (images, videos) in Anqi CMS?

As an experienced CMS website operation personnel, I know the importance of efficient content management for the success of the website.Whether it is a single page carrying the brand story or the images and video resources that constitute the visual experience, they are all core elements that attract and retain users.The Anqi CMS provides powerful and intuitive tools for fine-grained management of these contents, ensuring that the website is always presented in a **status to the audience.

2025-11-06

How does the navigation setting in AnQi CMS support multi-level menus and custom navigation categories?

As a website operator who deeply understands the operation of AnQiCMS, I am well aware of the importance of an efficient and flexible navigation system for website user experience and content presentation.The AnQi CMS provides great convenience and powerful content organization capabilities to website operators through its multi-level menu support and custom navigation category features.

2025-11-06

How to configure the automatic image processing (WebP, compression, thumbnails) in the content settings of AnQi CMS?

As a person who is deeply familiar with AnQi CMS and proficient in website content operation, I am well aware of the importance of image optimization for website performance, user experience, and search engine ranking.AnQi CMS provides a series of powerful automatic image processing features that can help operators efficiently manage and optimize website image resources.Below, I will give a detailed introduction on how to configure the automatic image processing in the content settings of Anqi CMS, including WebP conversion, image compression, and thumbnail generation.

2025-11-06

How to configure contact information and customize system global parameters in Anqi CMS backend?

As an expert in the operation of Anqi CMS, I understand that high-quality content cannot be separated from a stable backend configuration as a support.The contact information of the website and global system parameters, although it seems basic, is the key to user trust, brand image, and the normal operation of the website's functions.Now, I will elaborate on how to configure these important information on the Anqi CMS backend.

2025-11-06