How to create and customize new content models in Anqi CMS according to my business needs?

Calendar 👁️ 51

As an experienced security CMS website operation personnel, I know that content is the soul of the website, and a flexible content model is the foundation for supporting high-quality content creation and publication.The design philosophy of AnQi CMS in this aspect is to give operators greater freedom and adaptability to meet the ever-changing business needs and reader expectations.This article will detail how to create and customize new content models in Anqi CMS, thereby building a website content structure that is more tailored to your business characteristics.

Content Model: The framework for constructing website content

In Anqi CMS, the content model (also known as the document model) is the foundation for defining the type of website content and its properties.It is like a blueprint, specifying what information fields a certain type of content should include.For example, an "article" model may contain fields such as title, body, author, publish date, etc.And a "product" model may require fields such as product name, image, price, inventory, detailed description, etc.AnQi CMS provides highly flexible content model customization capabilities, allowing you to tailor data structures for each content type according to your actual business scenarios.

The system is default built-in with 'Article Model' and 'Product Model' which are commonly used models. These built-in models can be modified but cannot be deleted.For our daily operations, we encounter various unique content needs, such as "activity registration", "course list", "case display", etc., and we need to create customized content models to accommodate them.

Create a new content model

On the AnQi CMS backend management interface, you can manage and create content models through the 'Content Management' module under the 'Content Model' feature.

To create a new content model, you need to pay attention to the following core configuration items:

  • Model nameThis is a direct and intuitive identifier for you and your team, such as 'Event Registration', 'Solution'.It will serve as the Chinese name for the recognition model and will be displayed in the breadcrumb navigation.
  • Model table nameThis is the table name used to store the content of the model in the database. Please make sure to useEnglish lowercase lettersThis is the database specification requirement, if other content is filled in, it may cause the content to be displayed incorrectly.This table name is usually not recommended to be changed arbitrarily after creation, as it involves the underlying database structure.
  • URL aliasThis alias is used for calling pseudostatic rules, such as in/{module}/{id}.htmlsuch URL structure,{module}it will be replaced with this URL alias. It also supportsEnglish lowercase lettersThis helps maintain the neatness and SEO-friendliness of the URL.
  • Title NameThis field will be used as the prompt text for the title of the content you publish with this model.For example, if you create a "product model", you can set the title name to "product name", so that when you publish the product, the operation interface will display "product name" as the input prompt, which is more in line with the business context.

When creating a model, please be cautious. Especially when deleting a model, as it has a 'cascading effect', once the model is deleted, all its subordinate documents and categories will also be permanently deleted. This is an irreversible operation.

Exclusive field for custom content model.

After creating the basic model, the next step is to add unique "custom fields", which is the essence of the flexibility of the content model.By custom fields, you can ensure that each content type has the specific data required by its business logic.

In the content model editing interface, you can set dedicated fields for the model. Each custom field requires the following configuration:

  • Parameter NameThis is the Chinese name of the field displayed in the background and template, such as "article author", "product series".It is usually recommended to set it to English for convenience when calling the template.The system will automatically convert it to camel case for template use, but keeping the original English can also reduce ambiguity.
  • Field invocationThis is the actual field name in the database, as well as the identifier used in the template. Please make sure to useEnglish lettersFor example, if your parameter name is "article author", the calling field can be set toauthor.
  • Field type: Anqi CMS provides various field types to meet different data storage needs:
    • Single-line text: Suitable for storing brief text information, such as 'brand name', 'contact number', limited to 250 characters.
    • Number: Only numbers are allowed, suitable for 'price', 'stock quantity', etc.
    • Multi-line text: Suitable for storing long text content, such as 'product description', 'instructions', etc.
    • Single choice: Provide preset options that the user can select from, for example, "Product color", "Size (single selection)".
    • Multiple selectionsProvide preset options for users to select multiple items, such as "Product Features" and "Application Scenarios".
    • Drop-down selection: Similar to single selection, but presented in the form of a dropdown menu, suitable for situations with many options, such as "Product classification (customized)".
  • Mandatory?: You can decide whether the field is required according to your business needs. If set to required, the system will check the content when it is submitted.
  • Default valueThe field is set to the default value, which the system will automatically use if the user does not fill in this field.For the 'Single choice', 'Multiple choice', and 'Dropdown' types, the default value area is used to define their options.Enter an option per line, the system will automatically parse it into separate options.

These custom fields will be displayed in the "Other Parameters" collapse box on the document or category editing page during content editing, convenient for operators to fill in.

Display custom content in the front-end template.

The value of a custom field lies in its ability to present structured data on the website front-end.The Anqi CMS enables flexible calling and display of custom data through its powerful template tag system.

For example, you can usearchiveDetailTag to get details of a single document andname="您的自定义字段名"to directly get the value of this custom field.

{# 假设您为产品模型定义了一个名为“产品系列”,调用字段为“series”的自定义字段 #}
<div>产品系列:{% archiveDetail with name="series" %}</div>

If you want to cycle through all the custom parameters of a document, you can usearchiveParamsTags:

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

Similarly, you can use for category custom fieldscategoryDetailTags can be called in a similar manner.

In this way, you can fully control the display of each custom field, whether it is as text, image, link, or combined with other content, all can be flexibly realized in the template.

Summary

The content model function of AnQi CMS is a concentrated embodiment of its strength.By carefully designing and customizing the content model, you can not only efficiently manage various information on the website, but also ensure that this information is presented to users in the most suitable way for your business logic.As a website operator, mastering this core feature will greatly enhance your efficiency and effectiveness in content creation, publishing, and optimization, helping your website stand out in the highly competitive digital environment.


Frequently Asked Questions (FAQ)

1. What is the difference between "model table name" and "URL alias" when creating a content model? Why are they both required to use lowercase English letters?

“Model Table Name” is the actual name of the database table storing the model data, which belongs to the backend technology category, ensuring the uniqueness and specification of data storage. While “URL alias” is used as an identifier in the front-end web page URL structure, for example,yourdomain.com/solutions/detail-1.htmlIn, "solutions" may be the URL alias of some model.Both require the use of English lowercase letters to comply with database naming conventions, URL friendliness, and SEO practices.A standard English lowercase URL is helpful for search engines to crawl and understand, and can also avoid garbled or compatibility issues caused by Chinese or other special characters in URLs.

2. Can I add a picture carousel or multiple picture fields in a content model? How can I implement it?

Yes, you can achieve it. When adding custom fields in the content model, you can choose the 'Multi-line text' field type, and then agree on a specific format (such as one image URL per line, or in JSON format) to store image addresses.In the front-end template, you can usearchiveDetailTags get the content of the field and then go throughsplitThe filter or JSON parsing logic splits the image URL into an array, and thenforcycles through and displays these images. For example, if you have custom fieldsproduct_imagesStored multiple image URLs, you can call it in the template like this:{% archiveDetail images with name="product_images" %} {% for img in images %}<img src="{{img}}" alt="产品图片" />{% endfor %}This can display an image group on the front end.

How to modify or delete existing content models? What should be noted?

You can find and edit or delete existing content models in the Anqi CMS background "Content Management" -> "Content Model". When modifying the model, you can adjust the model name, title name, URL alias, or add, delete, or modify custom fields.Please note that modifying the 'model table name' requires great caution as it directly relates to the database table structure.Deleting a model is a high-risk operation. Anqi CMS explicitly states that deleting a model will cause the model to be deleted belowAll documents and categories are deleted togetherThis operation is irreversible. Therefore, be sure to confirm that you no longer need the model and all related content before performing the delete operation, and it is recommended to back up the data.In most cases, it is recommended to disable the model that is no longer in use instead of deleting it directly.

Related articles

What is the AnQi CMS content model? What role does it play in website content management?

As an experienced website operator who deeply understands the operation of AnQiCMS, I am well aware of the core position of content in the digital world.Effective management of website content is the key to attracting and retaining users.In the architecture of AnQiCMS, the content model is undoubtedly the cornerstone of this management system.It not only defines the form of content, but also plays a vital role in background operations, front-end display, and even SEO optimization.What is the Anqi CMS content model?

2025-11-06

How to make use of built-in

As an experienced website operator for AnQiCMS, I know that content is the cornerstone of a website, and a powerful and easy-to-use content management system is the key to the success of content operation.AnQiCMS with its excellent performance in the Go language and rich features, provides us with an ideal platform to efficiently create, publish, and optimize content, thereby attracting and retaining our target readers.### Optimize content production process, improve content quality One of the core strengths of AnQiCMS lies in its **flexible content model**

2025-11-06

How to use the full-site content replacement function of AnQi CMS for batch updating keywords or links?

As a senior security CMS website operator, I fully understand the core status of content in website operation, and the efficient management and update of content, especially batch operations in the face of massive information, is the key to improving operational efficiency.The "Full Site Content Replacement" function provided by AnQi CMS is a tool tailor-made for such needs.The core value of the website content replacement feature lies in its ability to allow website operators to update all keywords or links on the website in batches with extremely high efficiency.

2025-11-06

What advanced SEO tools does Anqi CMS provide, such as Sitemap, Robots.txt, keyword library management?

In the powerful content management system of AnQi CMS, we are well aware of the foundational role of Search Engine Optimization (SEO) in website operation.A great CMS should not only make content publishing simple but also provide a series of efficient tools to help this content stand out in search engines.The Anqi CMS is aiming for this, built-in multiple advanced SEO tools, aiming to enhance the search engine performance of the website.

2025-11-06

What are the core functions and preset fields provided by Anqi CMS' default 'Article Model' and 'Product Model'?

AnQiCMS (AnQiCMS) is a system dedicated to providing an efficient, customizable, and scalable content management solution, with its core content organization form being a flexible content model.To meet the general needs of small and medium-sized enterprises and content operation teams, the system is default built-in the "Article Model" and "Product Model", these two models not only preset rich fields to deal with common publishing scenarios, but also provide powerful customization capabilities, allowing operation personnel to carry out personalized expansion according to specific business needs.###

2025-11-06

Can I modify the built-in content model of Anqi CMS? What impact will it have on the content I have already published?

AnQi CMS is an efficient and flexible content management system, one of its core advantages is that it provides a highly customizable content model.As an operator familiar with AnQi CMS, I can clearly tell you that you can fully modify the built-in content model of AnQi CMS, and you can also create, modify, or delete custom content models.However, these changes are not without cost, and they will have varying degrees of impact on the content you have published.Firstly, let's talk about the modifiability of the content model in Anqi CMS.The system is pre-installed with the 'Article Model' and 'Product Model' basic models

2025-11-06

What will the system do when deleting a custom content model, handling all documents and categories under it? Are there data recovery options?

As a deep-seated website operator familiar with Anqi CMS, I understand your concerns about data security and processing mechanisms in system operations.It is crucial to clarify system behavior in daily content management work, especially when it involves adjusting core content models.Now, let's delve into how the system handles its subordinate documents and categories when a custom content model is deleted in Anqi CMS, and whether there are data recovery options.In the AnQi CMS architecture design, the content model is the foundation for organizing and managing specific types of content.It defines the structure of the content, fields, and the classification system below

2025-11-06

What is the difference between the 'model name' and 'model table name' in the content model? What specifications should be paid attention to when naming?

As an experienced CMS website operator, I am well aware that understanding the core concepts of the system is crucial when managing and optimizing website content.The content model is the foundation of AnQi CMS flexibility, allowing us to customize different types of content structures according to business needs.In this process, 'Model Name' and 'Model Table Name' are two concepts that are often mentioned but easily confused.Next, I will elaborate on the differences between them and the conventions to be followed in naming.

2025-11-06