In the operation practice of AnQi CMS, the flexible use of content models and custom fields is the key to improving website content management efficiency and achieving personalized display.As an experienced website operator familiar with AnQiCMS features, I will elaborately explain 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 advantages.This means you can define the structure of different types of content according to the specific needs of your business, such as articles, products, events, etc., and not just be limited to predefined fields.By adding custom fields, you can add unique properties to each content type, thereby achieving more refined content management and richer frontend display.

Types of custom fields supported

The Anqi CMS content model supports various practical custom field types to meet the needs of entering different data formats. These types include:

Single-line text: This field type is suitable for inputting brief text content, such as the subtitle of an article, the brand name of a product, etc.The input length is usually limited to 250 characters, ensuring the conciseness and consistency of the data.

Numbers: When you need to enter pure numeric data, such as product prices, inventory quantities, and article reading counts (except for system-provided ones), you can choose the numeric type.The system ensures that the input content is only numbers, avoiding data format errors.

Multi-line text: For situations where longer descriptive text is needed, such as brief introductions of product details, detailed descriptions of event rules, etc., the multi-line text field provides ample space.It allows users to input multiline text content, supporting more complex text descriptions.

Single choice: When you want users to select one from a preset set of options, the single choice field is very suitable.For example, the "recommendation level" of an article can be chosen as Level A, Level B, or Level C, and the user can only select one.The value of the option must be entered line by line in the default value setting.

Multiple choice: If the content may contain multiple properties of the same type, the multiple choice field can meet your needs.For example, a product may have multiple features such as waterproof, dustproof, shockproof, and so on, and users can select multiple options.Similar to single selection, the options are also set through default values.

Dropdown selection: Similar to single selection, dropdown selection fields are also used to select one from multiple predefined options, but they are presented in the form of a dropdown menu, which saves more interface space.For example, select the product's 'color' or 'size'.The option is also set line by line in the default value.

These field types cover most of the common data entry scenarios in content management, greatly enhancing the adaptability and scalability of Anqi CMS.

How to configure custom fields

In AnQi CMS, each custom field configuration includes several key properties that together determine the behavior and display of the field:

Parameter name: This is the Chinese name used to identify the field in the background interface and front-end template, such as 'Article Author' or 'Product Source'.This name will be displayed directly to the backend staff to help them understand the purpose of the field.

The field name: This attribute specifies the English name used to store the field in the database, and it is also the unique identifier for data calls in the front-end template. It must be in English letters, for exampleauthororsourceTo ensure that the data can be written and read correctly.

Field type: As previously mentioned, you can select 'Single-line text', 'Number', 'Multi-line text', 'Single choice', 'Multiple choice', or 'Drop-down selection' as needed.Once the field type is determined, it will decide the form of data entry and validation rules.

Is required: This setting determines whether the field must be filled in when publishing or editing content.If set to required, the system will force-check whether the field has been entered when submitting the content, ensuring the completeness of key information.

Default value: You can set a default value for the field.For single-choice, multiple-choice, and drop-down selection fields, the default value area is used to enter all available options, each option takes up one line, and the system will automatically parse and present it as a selection item.If the field has a default value and you want to use the default value when calling from the front end, leave it blank when entering.

Detailed steps to add custom fields

The process of integrating custom fields into the Anqi CMS content model is intuitive and easy to operate:

The first step is to log in to your Anqi CMS backend management system. In the left navigation menu, you will find the 'Content Management' option, click to expand and select 'Content Model'.

After entering the content model page, you will see the system's built-in 'Article Model' and 'Product Model', as well as any custom models you may have already created.You can choose to modify an existing model to add fields, or click the "Add" button to create a new content model.

Select or create a model to enter the model editing interface.Here, you will see an area named "Content Model Custom Field".Click the 'Add Field' button within the area to pop up a form for configuring a new field.

In the new popup form, you need to fill in and select each of the fields mentioned earlier one by one.Enter the Chinese display name of the field in "Parameter Name", and the English identifier in "Field Call".Next, choose the appropriate "field type" based on the data type, and decide whether it is required according to business needs.If the field is a selection or dropdown type, please enter an option on each line in the 'Default Value' area.

After configuring all fields, click the 'OK' or 'Save' button at the bottom of the form to save the newly added field to the current content model.You can repeat this process to add more required custom fields to the model.

After the field is added and saved, when you create or edit a document belonging to the content model under "Content Management", the newly added custom field will automatically display in the "Other Parameters" collapse area of the content editing page.At that time, you can fill in the data of these custom fields for each document as needed.

By following these steps, you can effectively expand the content management capabilities of AnQiCMS, making your website's content structure more refined and meeting various operational needs.

Summary

The AnQi CMS content model and custom field functionality provides powerful flexibility and customization space for website operators.No matter whether you are managing articles, products, or any other type of content, you can ensure the standardization and diversity of display by precisely defining fields.Mastery in adding and configuring custom fields will greatly enhance your content creation and website management, thereby attracting and retaining users more effectively.


Frequently Asked Questions (FAQ)

How to call custom field data in front-end templates?

You can use the template tags provided by AnQiCMS to call the data of custom fields. For example, if you add a field namedauthorThe custom field, set as "Call Field", then you can use it in the article detail page template.{% archiveDetail with name="author" %}Enter the value of the field directly. If you want to display all custom fields in a loop, you can use{% archiveParams params %}tags to get and iterate through.

2. Can a custom field be set as required? What happens if it is set as required but the user does not fill it out?

Yes, when adding custom fields, you can check the 'Is Required' option.If a custom field is set as required and the user fails to provide the value of the field when publishing or editing content, the system will perform a check and prompt an error when the user tries to save, preventing the submission of the content until the required field is filled in completely.This helps ensure the integrity of critical data.

3. How are options set and managed for single-choice, multiple-choice, or dropdown custom fields?

These selection type custom fields have their options set in the 'Default Value' area of the field configuration.You need to enter each option on a separate line.For example, if your field is "product color", you can choose "red", "blue", "green", and you need to enter these three words respectively in the default value area, one word per line.The system will automatically parse your input and generate the corresponding options.