How to create and manage custom content models and add fields in AnQiCMS?

Calendar 👁️ 95

In the daily operations of website management, the flexibility of the Content Management System (CMS) is crucial.Traditional CMS may only provide fixed models such as "articles" and "products", but this limitation becomes evident when facing rapid business changes and personalized content display needs.AnQiCMS (AnQiCMS) fully understands this point, therefore it provides powerful custom content model features, allowing operators to build content structures that fully meet their own needs according to business characteristics.

Today, let's delve into how to create and manage custom content models in AnQiCMS, and add the required fields to unlock the limitless possibilities of your website's content.

Why do you need to customize the content model?

Imagine that you are running a real estate information website, in addition to regular articles and news, you also need to publish 'real estate information'.Each plot not only has a title and content, but also a series of unique attributes such as 'house type', 'area', 'price', 'developer', 'traffic support' and so on.If we force this information into a general article model, it will not only be difficult to manage, but the front-end display will also be very difficult.

This is the time when the custom content model really shines.It allows you to define a dedicated structure for specific types of content, ensuring that each piece of information is properly organized and stored.Whether it is the 'ingredients' and 'cooking steps' of a 'recipe', or the 'start time', 'location', and 'number of participants' of an 'event', AnQi CMS can easily help you build these personalized content frameworks.This has greatly improved the efficiency of content management and also laid a solid foundation for accurate front-end display and user experience optimization.

Create your first custom content model

In the AnQiCMS backend, the operation path for managing custom content models is very intuitive. You just need to navigate toContent Managementand then clickContent modelOptions, you can enter the content model management interface.Here, you will see the built-in "article model" and "product model", as well as other custom models you may have created.

To create a completely new model, click the "Add Model" button on the interface, the system will guide you to fill in some basic information:

FirstlyModel name.This is a Chinese name, convenient for you to identify and manage in the background, such as 'real estate information', 'complete recipe' and so on.It will also appear in the breadcrumb navigation in the background, helping you to clarify the content type of the current operation.

Next isModel table name. This is the table name used by the system to store the model data in the database, therefore it must be usedEnglish lowercase lettersThis name is crucial, it ensures the uniqueness and standardization of data storage. Please make sure to choose a concise and meaningful English word.

Then it isURL aliasThis is also usedEnglish lowercase lettersIt will be used to build the URL structure of the website content, for example, in the pseudo-static rules, your custom model content may start with/module-alias/detail.htmlIt is displayed in the form. A clear, semantic URL alias is very beneficial for SEO and user-friendliness.

Finally isTitle Name.This is a flexible prompt text, used when you publish new content to prompt the content editor for the meaning of the current main content field.For example, if your model is "real estate information

Complete these basic information and save, your custom content model skeleton is set up.

Add dedicated fields to the model

After creating the model, the next step is to add specific fields to make the content truly rich.On the content model editing page, you will see a 'Content Model Custom Field' area.Click 'Add field', you will enter the field configuration interface.

Each custom field needs to define the following key attributes:

Parameter NameThis is the display name of the field in Chinese, such as 'Type', 'Area', 'Price', etc., which will be directly displayed on the content editing interface, convenient for editors to understand and fill in.

Field invocationThis is used to call the field data in the template, so it must be usedEnglish lettersFor example, if your parameter name is "house type", the field to be called can be set tohouseTypeFollow camelCase naming conventions (such ashouseAreaInsteadhouse_area) is a good practice.

Field type: AnQiCMS provides various field types to meet different data storage needs:

  • Single-line text: Suitable for short text input, such as 'Developer Name', 'Traffic Route'.
  • Number: Designed for numerical data, such as 'Sales Price', 'Floor Area'.
  • Multi-line text: Suitable for long text descriptions, such as 'property introduction', 'community features'.
  • Single choiceWhen you need to select one from a preset multiple options, for example, 'decorating situation' (bare, finished, simple finishing).
  • Multiple selections: Allow selecting zero, one, or multiple from multiple preset options, such as 'Support Facilities' (schools, hospitals, parks, supermarkets).
  • Drop-down selection: Similar to single selection, but presented in a dropdown menu, saving page space.

For the three types of "Single selectionDefault valueSet specific options for them, one option per line, the system will automatically parse and provide it to the editor for selection.

Mandatory?: You can choose whether a field is required based on its importance. If checked, the system will prompt for verification if the field is empty when the content is published.

Default value: In addition to the option settings for selecting types, for text and numeric field types, you can also set a default value to reduce the workload of content editing.

By combining these field types, you can build an extremely refined and structured content model to meet various complex business scenarios.For the "Real Estate Information

Content publishing and template invocation

After you have created the custom content model and its fields, when you publish content, you first need to select a category associated with the model (you can create and associate models in the document category).Once you select the corresponding category, the content editing interface will automatically display all the custom fields you defined for the model, for you to fill in.

In the front-end template, to display the data of these custom fields, Anqi CMS provides convenient template tags. You can usearchiveDetailtags to get the value of a single custom field, for example{% archiveDetail with name="houseType" %}The apartment type information of the current content can be displayed. If you want to traverse all custom fields or display in a more flexible way,archiveParamsThe tag will be a good helper for you, it can return all custom fields in an array form, allowing you to easily loop output in the template.

In this way, Anqi CMS not only helps you efficiently manage structured content on the back end, but also allows front-end developers to easily call and display these personalized data, thereby creating more attractive and high-quality websites that meet user needs.

Operation strategy and **practice

Creating and managing a custom content model is not a one-time task. In actual operation, some strategies and practices can help you better utilize this feature:

Plan firstBefore creating any models and fields, it is essential to communicate thoroughly with the content team and product team to clarify the content type, required properties, and future scalability.A detailed content structure diagram would be a good start.

Naming convention: The table name and field names called by the model (i.e., database field names) should follow clear and unified English naming conventions.This helps maintain the neatness of the background data structure and is convenient for subsequent template development and secondary expansion.

Consider SEOThe custom model URL alias affects the URL structure, be sure to choose meaningful English words, and combine it with AnQiCMS's pseudo-static function to optimize the SEO friendliness of the URL.

Step by step: Do not define all possible fields at once. You can start with the most core fields and gradually add or adjust model fields with the development of the business and changes in requirements, maintaining the flexibility of the system.

The AnQiCMS custom content model feature grants website operators great freedom, it upgrades your website from a static information display platform to a dynamic ecosystem that can flexibly respond to various content challenges.

Frequently Asked Questions (FAQ)

Q1: What is the relationship between the custom content model and 'Document Classification'?A1: Custom content models define the "skeleton" of content, and "document classification" is the categorization of content under this skeleton.Each category must be associated with only one content model.When you post content, you must first select a category, and then the system will display the corresponding custom fields for you to fill in based on the model associated with that category.This means that if your "property information" model can have different categories such as "new houses

Q2: What will happen if I delete a custom content model?A2: Deleting a custom content model is a very important operation as it will also delete all associated document content and the corresponding categories.The system will provide a clear warning to ensure that you fully understand the impact before performing this operation.Therefore, please consider carefully before deleting any custom models and confirm that the relevant content has no retained value or has been backed up.

Q3: How to display the custom field I added in the front-end template?A3: To display custom fields on the website front end, you need to edit the corresponding template file. AnQiCMS providesarchiveDetailandarchiveParamssuch template tags.

  • If you want to directly display the value of a specific custom field, you can use{% archiveDetail with name="您的调用字段名" %}For example,{% archiveDetail with name="houseType" %}.
  • If you want to iterate over all custom fields under the content model and display them, you can usearchiveParamsLabel: `{{ archiveParams params }}{% for item in params %}`{{item.Name}}:{{item.Value}}{% end

Related articles

How to manage and associate document tags in AnQiCMS?

## Unveiling AnQiCMS Document Tags: The Efficient Association and Management of Cross-Content Models In the world of content operations, how to organize information efficiently, make it easy to retrieve, and ultimately transform it into user value is the core concern of every operator.AnQiCMS (AnQiCMS) is an enterprise-level system designed specifically for content management, and it understands this pain point.It provides a powerful and flexible document tag management mechanism, especially showing its unique advantages in dealing with the association between different content models.Today, let's delve deeply into AnQiCMS

2025-11-07

How to customize document categories in AnQiCMS and set category templates and SEO information?

As a veteran in website operation for many years, I deeply understand the importance of a flexible and efficient content management system for website operation.AnQiCMS (AnQiCMS) boasts its high-performance architecture based on the Go language, rich customization features, and deep optimization for SEO, and is undoubtedly a powerful assistant for small and medium-sized enterprises and content operation teams.It not only makes content management simple, but also allows every corner of the website to bear the power of optimization.

2025-11-07

What advanced features does the AnQiCMS document content editor support, such as the material library and image resources?

In the daily operation of AnQiCMS (AnQiCMS), we understand that an efficient and intelligent content editor is the core driver of content productivity.It is not just a tool for text input, but also a bridge for content creators and operators to transform thoughts into high-quality content.AnQiCMS designed its content editor by precisely perceiving this need, and tirelessly integrated a variety of advanced features, especially in the material library and image resource management, demonstrating its meticulous craftsmanship in improving operational efficiency.### The foundation of content editor: A powerful and intuitive editing experience First

2025-11-07

How to add a new document and set recommended attributes, keywords, and SEO titles in AnQiCMS?

## AnQiCMS Content Operation Manual: Easily add documents to achieve double benefits of SEO and user experience As an experienced website operation expert, I am well aware of the importance of an efficient and intelligent content management system for enterprises and self-media.AnQiCMS (AnQiCMS) is gaining popularity among operators with its high-performance architecture developed in Go language and rich content management features.It not only makes content publishing simple, but also deeply integrates SEO optimization into daily operations, helping your website stand out in the fierce market competition.

2025-11-07

How to create independent pages such as 'About Us' and 'Contact Us' in AnQiCMS single-page management?

Certainly, as an experienced website operation expert, I am very willing to deeply analyze the essence of single-page management in AnQiCMS and guide you to easily master the creation and optimization of independent pages such as 'About Us' and 'Contact Us'. --- ## Single Page Management of Anqi CMS: Easily build independent pages such as "About Us" and "Contact Us" In modern website operations, independent pages such as "About Us" and "Contact Us" play a vital role.They are not only a window for displaying the corporate image and conveying core values, but also for users to build trust

2025-11-07

How to perform image classification and batch operations in AnQiCMS's image resource management?

As an experienced website operations expert, I am well aware that in the increasingly digitalized world of content, images are not just decorations, but also key elements to enhance user experience, optimize search engine rankings, and even carry brand value.In AnQiCMS (AnQiCMS) such an efficient and customizable content management system, how to intelligently manage a large amount of image resources so that they are both orderly and efficient is a core skill that every operator should master.

2025-11-07

How to configure the pseudo-static rules of AnQiCMS and what naming modes are supported?

As an experienced website operations expert, I know that a friendly URL structure is of great importance to the SEO performance and user experience of a website.AnQiCMS is a corporate-level content management system specially designed for content operators, and naturally provides strong and flexible support in this regard. The pseudo-static rule configuration is the core of it.Today, let's delve into the pseudo-static rules of AnQiCMS and see how it can help us build a more competitive website. ### Static URL Rewriting: Why It Matters, How AnQiCMS Handles It First

2025-11-07

How to configure Baidu and Bing link active push in AnQiCMS?

As a senior website operations expert, I am well aware that in the current fiercely competitive content ecology, how to make high-quality content faster to be discovered and indexed by search engines is the focus of every operator.Actively submitting new links to search engines is undoubtedly a key step in improving website visibility and SEO effectiveness.Today, let's delve into how to easily configure the active link push function of Baidu and Bing in the efficient AnQiCMS.

2025-11-07