In the daily operation of websites, we often encounter such needs: standard content structures, such as articles and products, cannot fully meet the unique display of our business.It may be necessary to add fields such as 'Author Source' and 'Publisher' for a specific type of information, or to add personalized attributes such as 'Size' and 'Material' for a product series.AnQiCMS (AnQiCMS) provides high flexibility in content management, allowing us to customize the content structure according to actual business scenarios and display it accurately on the front end.

Next, we will understand step by step how to achieve this goal in Anqi CMS.

Part one: Understanding the content model of Anqi CMS.

In AnQi CMS, 'Content Model' is the core function to define the skeleton of content types.The system is pre-installed with the "article model" and the "product model", which respectively define the basic fields that should be included in content such as articles and products, such as title, content, abstract, thumbnail, etc.However, business requirements are often far more than these standard fields. The strength of AnQi CMS lies in its ability to expand based on these basic models, even to create new content models that can carry a variety of personalized data.

Why should you customize the content model? In short, it is to make your content management more accurate and efficient.By customizing the content model, you can ensure that the entered content always conforms to business logic, avoiding information omission or confusion.At the same time, this structured content also lays a solid foundation for the precise display on the front end.

The second part: the background operation of custom content structure

In Anqi CMS background, custom content structure is an intuitive and feature-rich process.

Step 1: Create or edit the content model

First, you need to enter the "Content Management" module in the background, find the "Content Model" option. Here is a list of all existing content models, including system-built-in and custom ones.

If you want to add fields based on existing models (such as articles or products), you can directly click on the corresponding model to edit.If your business needs a completely new content type, such as "event registration" or "project case", then you can choose to "add a new model".

On the model editing or creation page, there are several core fields that need to be paid attention to:

  • Model nameThis is a friendly identifier for yourself and the admin, for example, 'Project Case', 'Recruit Talents', etc.
  • Model table nameThis is the table name stored in the database for content data, it must be lowercase letters. This is an important basis for calling the model data in the front-end template.
  • URL aliasUsed to build the alias of static rules for URL, it is also recommended to use lowercase letters, which will directly appear in the URL structure of your website.

Step two: Add custom fields

Below the model configuration page, you will see the "Content Model Custom Fields" area.This is the key to add personalized data to your content structure.Click 'Add field', you can define various fields required for the model.

You need to configure the following properties for each field added:

  • Parameter Name: This is the display name of the field when editing content in the background, such as "Project Leader", "Case Time".
  • Field invocationThis is the unique identifier used to call this field data in the front-end template, must use letters, for example `projectManager