In today's rapidly changing digital world, the richness and diversity of website content are crucial for attracting and retaining users. AnQiCMS (AnQi Content Management System) provides a powerful feature in content management, namely,Content ModelIt enables websites to easily build and display various structured contents, meeting users' various needs for content display.

What is the content model of AnQiCMS?

One of AnQiCMS's core strengths is its flexible content model design.In simple terms, the content model is the 'blueprint' or 'skeleton' of your website content, 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 tailor exclusive data structures for them.

How to customize the content model?

In AnQiCMS, custom content models are a straightforward and powerful process.You can create independent content models for different types of content based on actual business scenarios.For example, if you run 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.

Enter the AnQiCMS admin interface, under the 'Content Management' module, you can find the settings entry for 'Content Model'.Here, you can not only modify the built-in 'Article Model' and 'Product Model', but also create completely new custom models as needed.

  • Model nameThis is the Chinese identifier for the model in the background management, such as '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, and it must be in lowercase English letters to ensure the normal operation of the system.
  • URL aliasThis setting determines the representation of content under this model in the website URL, and it also needs to use lowercase English letters. It is related to the pseudo-static rules in{module}Variable association is crucial for SEO optimization and building a clear website structure.
  • Title nameThis setting affects the hint text for the main title field on the content publishing page.For example, in a "Job Position

The core flexibility of a custom content model is manifested inCustom fields of the content modelSettings. You can add unique fields for each model to meet specific content display needs:

  • Parameter nameThis is the display name of the field, for example 'Department of Publication', 'Salary Range', 'Number of Travel Days', etc., which is convenient for backend management and frontend display.
  • Call fieldThis is the field name stored in the database and called in the template, it is recommended to use English, such asdepartment/salary/duration.
  • field type【en】AnQiCMS provides various field types to accommodate different data storage and display needs:
    • Single Line Text【en】Used for short text input, such as author names, article sources.
    • NumberEnsure that the input data is pure numbers.
    • Multi-line textApplicable to longer text descriptions, such as job descriptions, precautions.
    • Single selectionProvide preset options, but only one can be selected, such as 'Position Level', 'Travel Season'. The option values are defined by line breaks (one option per line) when setting up.
    • Multiple selectionSimilarly, provide preset options that can be selected multiple times, such as 'Benefits' and 'Travel Methods'.
    • Drop-down selectionPresent single-choice options in the form of a dropdown menu.
  • Is requiredYou can强制要求内容编辑者填写某个字段。
  • Default valueSet an initial value for the field. If not filled in during editing, the default value will be applied automatically. For selection type fields, the default value is the available options.

Application of content model in content publishing

Once you define the content model and its custom fields, it will play a key role in the content publishing process. When we are ready to add a new document, the first thing we need to do is 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 Showcase" category is associated with the "Product" content model.

Once a category is selected, AnQiCMS will automatically identify the content model associated with that category and dynamically display the model below the content editing interface.Other parametersThat is, those custom fields we defined before.For example, if you select the 'Travel Guide' category, the interface will display custom fields such as 'Number of Travel Days', 'Mode of Travel', 'Accommodation Standards', and more for you to fill in, ensuring that each travel guide includes 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 powerful template engine (based on Django template engine syntax) makes it very simple to call data from the content model on the front end.By using rich template tags, we can easily display structured data filled from the backend on the website.

  • For standard fields of the document itself (such as title, content, thumbnail, etc.), we can directly access through{{archive.Title}}/{{archive.Content}}in this form