As a senior security CMS website operator, I know that flexible content management is crucial for meeting ever-changing business needs.The Anqi CMS provides us with a highly customizable framework through its powerful content model functionality, allowing us to go beyond traditional article and product models to build content types that truly fit specific business logic.

This article will elaborate on how to create and utilize custom content models in Anqi CMS to help you better organize and display website content, thereby enhancing user experience and operational efficiency.

The core value of the flexible content model

The flexible content model of AnQi CMS, as emphasized in its project advantages, is the key to meeting the needs of diverse content structure publication.It allows us to define new content types based on the unique characteristics of the business, rather than being limited to the system-built articles or products.For example, if you operate a real estate website, you may need a content model such as "List of PropertiesIf your business involves event promotion, then the "event schedule" model may require fields such as "start time

This customized capability not only greatly enhances the adaptability of the system, ensures the structurization and standardization of content, but also lays a solid foundation for the SEO optimization of the website and user data analysis.By precisely defining content fields, we can collect, display, and manage information more accurately, thus better serving our readers and business goals.

Plan your custom content model

Before any operation, meticulous planning is the primary step in creating any content model.This is like designing a house blueprint, only clear planning can ensure the stability and practicality of the final result.

First, please clarify your specific business requirements?What kind of information do you want to manage and display through this new content model?Once the business goal is determined, the next step is to outline all the data points required for the content type.For example, for a "job posting" model, you may need the following information: job title, location, salary range, educational requirements, work experience, job responsibilities, qualifications, and application methods, etc.

During the planning process, it should also be considered what specific type each data point is.Is it a simple line of text?Do you need to enter a number?Still need multiline description?Does there exist a fixed set of options for users to choose from (such as 'full-time', 'part-time', etc.)?And which fields are required, and which can be optional?A clear plan will directly affect the efficiency and accuracy of your model configuration in the Anqi CMS backend.

Create a custom content model in Anqi CMS

The AnqiCMS backend provides an intuitive interface for creating and managing content models.

To start creating your custom content model, please log in to the Anqi CMS backend, navigate to the "Content ManagementYou will see the built-in 'article model' and 'product model'.To add a new content type, you will initiate the creation process by clicking on the corresponding operation button on the interface (usually the "Add New Model" button or similar).

When creating a new model, you need to fill in some basic information:

  • Model nameThis is the Chinese name you identify the model in the background, for example, “Real Estate List”, “Event Schedule” or “Job Posting”.It will also be displayed in breadcrumb navigation and other locations, convenient for administrators to understand and operate.
  • Model table nameThis field is used to specify the table name where the content model data is stored in the database. It must be usedEnglish lowercase lettersEnsure its uniqueness. This is a low-level identifier and it is not recommended to modify it once created, as changes may lead to data loss or system function exceptions.
  • URL aliasThis lowercase field is used in the front-end URL structure, usually as part of the static rules in{module}variables. For example, if set tohouse, then the URL of the listing page may contain/house/ensure it is in lowercase english and descriptive.
  • Title Name

define the model's exclusive field

Custom fields are the core embodiment of the flexibility of the content model. Here, you can add any specific data fields that you determine in the planning phase for the new model.

In the model editing interface, there is usually a section called 'Content Model Custom Fields', click 'Add Field' to add one by one:

  • Parameter NameThis is the Chinese name displayed in the backend content editing interface, such as 'Number of bedrooms', 'Event location', 'Salary range'.
  • Field invocationThis is the unique English identifier you reference for this field in the database and template. For example,bedrooms/event_location/salary_rangeThis field must beEnglish lowercase lettersThis is the name used when calling data in the template.
  • Field typeAccording to the data type you plan, choose the most suitable field type:
    • Single-line textSuitable for short text inputs, such as contact numbers, brief titles, etc.
    • Number: Designed for numeric input, such as price, area, quantity, etc.
    • Multi-line text: Suitable for longer text descriptions, such as job responsibilities, event details, etc.
    • Single choice:Provide preset options for the user to choose from one (for example, property types: apartment, villa, townhouse).
    • Multiple selections: Provide preset options, the user can select multiple (for example, property facilities: gym, swimming pool, parking spaces).
    • Drop-down selection: Similar to single selection, presented in a dropdown menu.
  • Mandatory?Check this