In today's rapidly changing digital world, the richness and diversity of website content are crucial to attracting and retaining users. AnQiCMS (AnQiCMS) provides a powerful feature in content management, namely,Content modelIt makes it easy for websites to build and display various structured content, meeting users' various needs for content display.

What is the content model of AnQiCMS?

One of the core strengths of AnQiCMS is its flexible content model design.In simple terms, a content model is the 'blueprint' or 'skeleton' of the content on your website, defining which fields a particular type of content should include, what data types those fields are, and how they should be organized and presented.Different from traditional content management systems that often preset fixed content types such as "articles" or "products", AnQiCMS allows you to create highly customized content structures based on your business logic and specific needs.This means that whether you need to publish press releases, case studies, recruitment information, or create detailed travel guides or product parameter lists, you can customize dedicated data structures for them.

How to customize the content model?

In AnQiCMS, custom content models are an intuitive and powerful process.You can create independent content models for different types of content based on actual business scenarios.For example, if you operate an e-commerce website, in addition to basic product information, you may also need to add fields such as 'size', 'color' for clothing products, and 'processor', 'memory' for electronic products.

Log in to the AnQiCMS backend management interface, under the "Content Management" module, you can find the settings entry for the "Content Model".Here, you can not only modify the built-in "article model" and "product model", but also create brand new custom models as needed.Each content model requires you to define some basic information:

  • Model name: This is the Chinese identification of the model in the background management, for example, 'Travel Guide', 'Recruitment Position'. It will help you clearly identify and manage different types of content.
  • Model table nameThis is the unique identifier stored in the database, it must be in lowercase English letters to ensure the normal operation of the system.
  • URL aliasThis setting determines the representation of the content under the model in the website URL, and it should also use English lowercase letters. It is related to the rules of pseudo-static pages.{module}Variables are associated, which is crucial for SEO optimization and building a clear website structure.
  • Title NameThis setting will affect the prompt text of the main title field on the content publishing page.For example, in a "recruitment position" model, you can set the title name to "position name" to make it clear for content editors to fill in.

The most core flexibility of the custom content model is reflected in.Custom fields for content modelOn the settings. You can add unique fields for each model to meet the specific display needs.

  • Parameter NameThis is the display name of the field, such as "publishing department", "salary range", "number of travel days", etc., convenient for background management and front-end display.
  • Field invocationThis is the field name stored in the database and called in the template, recommended to use English, such asdepartment/salary/duration.
  • Field type:AnQiCMS provides various field types to adapt to different data storage and display:
    • Single-line text:Used for short text input, such as author name, article source.
    • NumberEnsure that the input data is purely numeric.
    • Multi-line textSuitable for longer text descriptions, such as job descriptions, precautions.
    • Single choiceProvide predefined options, but only one can be selected, such as "Position Level", "Travel Season". The option values are defined by the newline character (one option per line) when set.
    • Multiple selectionsSimilarly, preset options are provided but can be selected multiple times, for example, "benefits and treatment", "means of transportation".
    • Drop-down selectionOptions are presented in a dropdown menu format.
  • Mandatory?You can force the content editor to fill in a field.
  • Default valueSet an initial value for the field. If not filled in during editing, the default value will be automatically applied. For selection-type fields, the default value is the available options.

The application of content model in content publishing

Once you have defined the content model and its custom fields, it plays a crucial role in the content publishing process. When we are ready to add new documents, we first need to select aCategory. This category is associated with a specific content model.For example, you may have a "news center" category that is associated with the "press release" content model;Another "product display" category will be associated with the "product" content model.

Once a category is selected, AnQiCMS will automatically identify the content model belonging to that category and dynamically display the model below the content editing interface..These are the custom fields we defined previously. For example, if you select the "Travel Guide" category, the interface will display custom fields such as "Number of Travel Days", "Mode of Transportation", and "Accommodation Standards" for you to fill in, ensuring that each travel guide contains complete structured information.This dynamically adjustable editing interface greatly improves the efficiency and accuracy of content editing.

Flexible invocation of content models in front-end templates

AnQiCMS is a powerful template engine (based on Django template engine syntax) that makes it very simple to flexibly call data from the content model on the front end.By using rich template tags, we can easily display structured data filled in from the backend on the website.

  • For the standard fields of the document itself (such as title, content, thumbnail, etc.), we can directly access through{{archive.Title}}/{{archive.Content}}and so on to call them