How to create and manage content models in AnQiCMS and

Calendar 👁️ 60

As an experienced CMS website operation personnel, I fully understand the importance of flexible content management for the successful operation of the website.The AnQi CMS, with its powerful content model features, provides a solid foundation for us to meet various content needs.Next, I will elaborate on how to create and manage content models in AnQiCMS, so that you can efficiently build and publish various types of content.

Understanding the content model in AnQiCMS

In AnQi CMS, the content model is the core to define the structure of specific types of content.It acts as a blueprint for the content, specifying which fields should be included, the types of these fields, and how they should be stored and displayed.For example, an 'article' model may include title, author, body, publication date, etc., while a 'product' model may include product name, price, inventory, image set, etc.The AnQi CMS is default built-in with 'Article Model' and 'Product Model', which meet the basic needs of most websites.However, facing the diverse content display of corporate marketing, self-media operation, and other areas, the ability to customize content models is particularly crucial. It greatly enhances the adaptability of the system, allowing us to create personalized content structures according to specific business needs.

Creating a custom content model

When the structure of your existing content model cannot meet specific business needs, AnQi CMS allows you to create a new content model.This allows the system to adapt to various content structures, such as event details, recruitment information, course lists, and so on.

When creating a new content model, you need to set several basic properties of the model:

FirstlyModel name. This is the Chinese name used to identify the model in the background management interface and breadcrumb navigation, please name it clearly and easily understandable according to the type of content you provide.

Next isModel table name. This name will be used as the table name for the custom field content stored in the database. Be sure to useEnglish lowercase lettersAvoid using special characters or Chinese, as irregular table names may cause content to be displayed incorrectly.

Next isURL alias. This alias is used for pseudo-static rules.{module}The field's invocation will be directly displayed in the website's URL. Therefore, it is also necessary to useEnglish lowercase lettersto define, in order to ensure the standardization and aesthetics of the URL structure.

Finally isTitle Name.This is a user-friendly setting, which will serve as the prompt text for the document title input box when publishing content.For example, if you create a product model, you can set the title name to "Product Name" so that content editors can clearly understand the purpose of this field.

Define custom fields for the content model

The most powerful feature of AnQi CMS content model is its customizable fields.You can add exclusive fields for each custom content model to accurately match your content structure needs.For example, add options such as 'color', 'size', and others to the 'product' model.

When adding a field, you need to configure the following aspects:

Parameter NameIs the field displayed to the user on the back-end interface, for example, 'article author', 'product price'.Although Chinese is supported, it is recommended to use English camel case naming conventions to improve readability and facilitate subsequent development.

Field invocationThe actual name of the field stored in the database, as well as the identifier called in the template. This field name must be usedEnglish lettersFor exampleauthororprice, and should not contain special characters or spaces.

Field typeDecided the form of content input and the way data is stored. Anqi CMS provides a variety of field types for selection, including:

  • Single-line text: Suitable for short text input, such as titles, brief descriptions.
  • Number: Only numeric input is allowed.
  • Multi-line text: Suitable for fields requiring longer text input, such as article content, product details.
  • Single choiceProvide multiple options, but only one selection is allowed, and the option values are set through default values.
  • Multiple selectionsProvide multiple options, and multiple selections are allowed, with option values set through default values.
  • Drop-down selection: Display options in a dropdown menu, only one option is allowed to be selected, and the option value is set through the default value.

Mandatory?Used to set whether the field is required to be filled in when publishing content. If set to required, the system will perform verification when the content is submitted.

Default valueCan you set a default value for the field.For single-choice, multiple-choice, and dropdown fields, the default value will be used to define all selectable options, with each option value occupying a separate line.

Management and integration of content models

After creating and defining the content model, you can modify them at any time in the admin interface.You can adjust the model name, URL alias, or add, modify, and delete the custom fields below.

However, in decidingDeleteBe particularly careful when dealing with content models. Once the model is deleted, all documents and categories under it will also be permanently deletedAll documents and categories will also be permanently deletedThis is an irreversible operation. Therefore, please make sure to consider and back up the data before performing the deletion.

When you publish documents in the background, after selecting the category to which they belong, if the category is associated with a custom content model, then you will see all the custom fields defined by the model in the 'Other Parameters' collapse box.You can fill in the content of these fields as needed.If the custom field is set to a default value and you want to use the default value, you can leave it blank.

In the front-end template, you can call the data of the content model through specific tags. For example,archiveDetailThe tag can retrieve the details of the document, including all the custom fields of the content model it belongs to;archiveParamsTags can be used to specifically retrieve the custom parameter list of a specified document. These tags make the content model seamlessly connect with the website front-end display, achieving highly flexible content output.

By using the flexible content model function of AnQi CMS, we can easily manage various complex content structures, bringing great convenience and efficiency improvement to website operation.


Frequently Asked Questions (FAQ)

Ask: Can I modify the custom fields of the built-in 'Article Model' or 'Product Model' in AnQi CMS?Yes, you can modify the default built-in "article model" and "product model" of Anqi CMS, including adding, editing, or deleting the custom fields under them to meet your specific needs.Please note that the built-in model itself cannot be deleted.

Ask: Why can't I see the custom fields I defined when publishing the content I created?Answer: This is usually because the "category" you selected when publishing the content is not associated with the new content model you created.In AnQi CMS, the type of the document is determined by its category.You need to go to the 'Document Category' management page, edit the related categories, and associate them with the new content model you created. This way, when publishing documents belonging to the category, the corresponding custom fields will be displayed.

Ask: What are the consequences of deleting a custom content model?Answer: Deleting a custom content model is a very sensitive operation. Once you delete a custom content model, all documents published under that model and all associated categories will bePermanently deleteTherefore, please make sure to confirm carefully before performing this operation, and it is recommended to make a data backup in advance.

Related articles

How to optimize the TDK (Title, Description, Keywords) of AnQiCMS website homepage?

As a website operator who deeply understands the operation of AnQiCMS, I know that the home page TDK (Title, Description, Keywords) plays a foundational role in the website's SEO strategy.A meticulously optimized homepage TDK can clearly convey the core value of the website to search engines and also attract users' attention in search results, thereby improving click-through rates.AnQiCMS is a system that focuses on providing an efficient, customizable, and easily scalable content management solution and is inherently SEO-friendly

2025-11-06

Where is the global function setting (website name, logo, filing number) of AnQiCMS modified?

As an experienced website operator who deeply understands the operation of AnQiCMS, I know that content creation, publication, and optimization are the key to the success of the website, but all this is based on the correct and reasonable configuration of the website's core settings.The name of a website, its brand logo, and compliance information (record number) are the most direct impression of the website when a user first contacts it, and they are also the foundation for building trust and a professional image.Many operators will encounter the problem of how to modify these global feature settings in the early stage.Today, I will give you a detailed explanation of AnQiCMS

2025-11-06

How to customize the website navigation menu (multi-level navigation) in AnQiCMS?

As an experienced AnQiCMS website operations manager, I am well aware that a clear and efficient navigation menu is crucial for the website's user experience and search engine optimization (SEO).AnQiCMS with its excellent flexibility and customizability, provides us with powerful tools to build and manage multi-level navigation.This article will elaborate on how to customize and implement a multi-level navigation menu in AnQiCMS.### Understanding AnQiCMS' Navigation System Architecture The design of AnQiCMS' navigation system adheres to its core principles of efficiency and ease of use

2025-11-06

How to automatically compress large images in AnQiCMS and set thumbnail processing methods?

As an experienced website operator who is well-versed in the operation of AnQiCMS, I fully understand that in daily content management, image optimization is a key link to improve website performance and user experience.Especially for websites that contain a large number of images, properly handling the compression of large images and the generation of thumbnails can not only effectively save server storage space and bandwidth, but also significantly accelerate page loading speed, thereby improving SEO performance and retaining visitors.AnQiCMS provides powerful and flexible built-in features for image processing, allowing us to easily achieve these goals.

2025-11-06

What is the Vim/Vi operation referred to by "ws save and exit" in the `crontab -e` command?

## Parsing the "ws save and exit" operation in the `crontab -e` command When deploying and maintaining AnQi CMS, the `crontab -e` command is a common command used to edit system scheduled tasks to ensure the continuous operation of the website service and the automation of maintenance tasks.In the AnQiCMS deployment document, we noticed that when editing the `crontab` task, the prompt information appeared with the text "# ws save and exit".This may confuse some users who are new to or not familiar with Vim/Vi editors

2025-11-06

How to correctly execute 'Save and Exit' after modifying the scheduled task of AnQiCMS on a Linux server to ensure the task takes effect?

As an experienced CMS website operation personnel of an information security company, I am well aware of the importance of managing scheduled tasks on Linux servers for system stability and automated operation and maintenance.When you need to adjust the Anqin CMS schedule task, whether it is to schedule the application to start, execute the data backup script, or handle other custom automation processes, ensuring that the modified task takes effect correctly is crucial.This process usually involves the Linux system's `crontab` tool and the correct operation of its built-in editor.###

2025-11-06

If the "ws save and exit" mentioned in the AnQiCMS document is a typo for `wq`, what is the difference between `wq` and `x` in Vim for saving and exiting?

As an experienced security CMS operator in the field of content management for many years, I fully understand the importance of every detail to the efficiency of content work, whether it is the content creation itself or the technical operations behind it.When dealing with template files, optimizing content snippets, or configuring system scripts, we often deal with various command-line tools, and Vim editor is one of them.

2025-11-06

How to verify that the AnQiCMS service can automatically start after saving and exiting the `start.sh` script added to crontab?

The automatic startup verification method of AnQiCMS is crucial to ensure that core services can run stably and automatically in website operations.For AnQiCMS, configuring the `start.sh` script to the `crontab` is to automatically restore its running state after system startup or accidental service termination, ensuring the continuous availability of the website.Complete the configuration of the `start.sh` script and add it to `crontab`, and the detailed verification steps are crucial to ensure that this automation mechanism works as expected.

2025-11-06