How to use the content model in AnQiCMS to define different content display structures?

Calendar 👁️ 64

AnQiCMS Content Model: The Smart Choice for Flexible and Variable Website Content Creation

In the digital age, a website is not just a platform for displaying information, but also a gathering point for diverse content such as corporate brands, product services, and professional knowledge.If always using a fixed display structure for different types of content, the website content is likely to become monotonous and difficult to manage efficiently.AnQiCMS deeply knows this, the "content model" feature it provides is the core tool to solve this pain point, helping us easily define and manage various unique content display structures.

Imagine if your website needs to publish news articles, display product details, introduce team members, or preview upcoming events, these contents are often very different in structure.A traditional management system may only provide a general "article" publishing interface, forcing you to cram product prices, event dates, and other information into the article body, or勉强拼凑 through custom fields.This is not only inefficient, but also difficult to unify and beautiful in front-end display.

AnQiCMS's content model, as if tailor-made 'blueprints' for each of your content types.It allows you to define exclusive data fields and display methods for different types of content based on actual business needs.

Content Model, make your website structure as you wish

The core concept of the content model is to decouple content data from display logic. It allows us to:

  • Say goodbye to the same old generic templates: No longer limited to the default types of "articles" and "products".You can create various models such as 'Case Display', 'Service Projects', 'Event Schedule', 'Talent Recruitment' as needed, so that each type of content has its own dedicated structure.
  • Achieve precise content entryWhen publishing a product, the system can display fields such as "Product Name", "Price", "Stock", "Details Gallery", etc.When posting an event, it will display the 'event title', 'start time', 'end time', 'registration link', and so on.This way, the content editor only needs to pay attention to the fields related to the current content type, thus avoiding confusion and omissions.
  • Optimize content display and management: Structured data is easier for search engines to understand, and it is also convenient for websites to filter, sort, and recommend.For background management, the content of different models is well-organized, making search and editing more efficient.

How to create and manage content models in AnQiCMS?

In the AnQiCMS backend, the content model is located under the "Content Management" module.The system provides the 'article model' and 'product model' by default, which can be used directly and can also be adjusted according to our specific needs.Of course, we can also completely create our own new model.

When we create a new content model, some basic configurations need to be made:

  1. Model nameThis is a Chinese name that is easier for us to understand, such as 'team member', 'successful case'. It will be displayed in the management interface of the background.
  2. Model table nameThis is a unique combination of lowercase English letters used for database storage.Although we do not need to operate the database directly, understanding its use for underlying storage helps us standardize naming.
  3. URL aliasThis is also a combination of lowercase English letters, which determines the URL structure of the front-end content of our website.A clear and meaningful URL alias is very helpful for SEO optimization.
  4. Title NameThis configuration will affect the prompt text of the "Document Title" input box when publishing content, for example, for "Product Model", we can set it to "Product Name" so that publishers can see at a glance.

Custom field: The power of the content model

The flexibility and variability of the content model is truly brought about by its "custom field" feature.In the model configuration, we can add a series of exclusive fields for each model, which will determine the specific information contained in the model content.

  • Parameter NameThis is the Chinese display name of the field on the back-end interface, such as 'author', 'source', 'product features', etc.
  • Field invocationThis is the English name used when calling this field in the template.To facilitate memory and maintain code standards, we usually use meaningful English words or pinyin, such as 'author', 'source', 'features'.
  • Field type: AnQiCMS provides various field types to meet the needs of different data entry requirements:
    • Single-line text: Suitable for titles, short descriptions, etc., not exceeding 250 characters.
    • NumberEnsure that the input data is purely numeric.
    • Multi-line text: Suitable for long text content, such as product descriptions and detailed explanations.
    • Single choice, multiple choice, dropdown choiceThese three fields are particularly powerful, allowing us to preset some options that users can only select (single choice/dropdown) or select multiple (multiple choice).These options' default values are exactly what we input line by line in the background.
  • Mandatory?: Can set required fields for important fields to ensure the integrity of the content.

Combining content with models

In AnQiCMS, the content model is associated with actual content through "Categories".When we create a category, we must specify a content model for it.This means that the same content model can have multiple different categories, but each category can only belong to a specific content model.

When we publish new content in the background, we will first select the category it belongs to.Once the category is determined, AnQiCMS will automatically load all the custom fields associated with the content model of the category, presenting us with a highly customized publishing interface.

How to display these model contents in front-end templates?

AnQiCMS's template system borrows the syntax of the Django template engine, using{{变量}}to output data,{% 标签 %}To implement logical control. For custom fields of the content model, we can flexibly call them in the template:

  • Directly retrieve a specific fieldIf you know the name of the "called field" of a custom field (for exampleauthor), you can use it directly on the document detail page{% archiveDetail with name="author" %}To output their values.
  • Loop to display all custom fieldsFor situations where you need to dynamically display all additional parameters, you can use{% archiveParams params %}Loop through these fields, through{{item.Name}}Get the parameter name,{{item.Value}}Get the parameter value. This is very practical in scenarios such as product parameter lists.
  • Use the model-specific template: AnQiCMS allows us to define independent template files for different content models. For example, the article model can usearticle/detail.html, and the product model can useproduct/detail.htmlIn this way, each model's content can have a unique layout and style.

By the content model, AnQiCMS brings unprecedented flexibility and efficiency to website content management.Whether it is a small and medium-sized enterprise, a self-media or a user who needs to manage multiple sites, they can easily build a clear, powerful, and highly adaptable personalized website with this.


Frequently Asked Questions (FAQ)

Q1: Can I change the content model of an item after it has been published?

A1: In most cases, an item of content (such as an article or a product) is bound to the category it belongs to, and the category is associated with a specific content model.This means that once the content is published, the category and content model it belongs to are fixed.If you indeed need to change the model of the content item, the most direct method is to create a new content item and publish it to the category associated with the new model, then delete the old content.

Q2: What impact does deleting a content model have?

A2: Delete the content model is a very important operation, please be cautious.Once you delete a content model, all categories associated with the model and all documents (articles, products, etc.) under these categories will be permanently deleted and cannot be restored.Therefore, before performing this operation, please confirm that you no longer need the model and all related

Related articles

How to render the category Banner image set in the backend in the front-end template?

In AnQi CMS, displaying the Banner images of categories on the front-end template is a common operation that can effectively enhance the visual effects of the page.AnQi CMS provides flexible backend settings and powerful front-end template tags, making this process simple and intuitive. --- ### Step 1: Set up Category Banner Image in the Backend Firstly, we need to upload a Banner image for the target category in the Anqi CMS backend management system.This operation is very intuitive: 1. Log in to your Anqi CMS backend.2.

2025-11-07

How to display a custom shutdown prompt to users when the website is under maintenance in AnQiCMS?

During the operation of the website, maintenance and upgrades are inevitable steps.Whether it is system updates, data migration, or solving some unexpected problems, the website needs to be temporarily closed to ensure the smooth progress of operations and the integrity of the data.How can you inform the visitor in a friendly manner that the website is under maintenance, rather than making them face a blank page or error message, which is particularly important.AnQiCMS provides a flexible shutdown prompt mechanism to help you display professional and clear custom information to users during website maintenance.### Enable Station Mode

2025-11-07

How can I use the custom URL alias of articles or categories for pseudo-static link display?

## Leverage the advantages of AnQi CMS custom URL alias to create SEO-friendly static links In website operations, a clear and semantically meaningful URL address not only helps users understand the content of the page at a glance, but also wins the favor of search engines, thus improving the inclusion and ranking of the website.AnqiCMS (AnqiCMS) is well-versed in this, providing powerful custom URL alias and flexible static configuration features to help website operators easily achieve this goal.Why is it so important to use custom URL aliases and permalinks?Imagine

2025-11-07

How to control the style of each element within a loop in AnQiCMS templates (such as odd and even rows differently)?

In website content display, we often need to present data in a list form, such as article lists, product lists, or category navigation.To make the page more attractive or to better organize information, we often hope that each element in the list has a different style, such as the common even-odd row background **split.AnQiCMS provides a powerful and flexible template system, making it very simple to implement these fine style controls.AnQiCMS's template system borrows the syntax of the Django template engine, which is characterized by the use of double curly braces for variables

2025-11-07

How to display the reading and comment counts of articles on the front end?

In website operation, the number of article views and comments is an important indicator of content popularity and user interaction.AnQiCMS as a flexible content management system provides a convenient way to display these data on the website front end.By using simple template tags, even without delving into programming, these functions can be easily realized.The AnQiCMS template system borrows the syntax of the Django template engine, using double curly braces `{{variable}}` to output variable content, and using single curly braces and percentages `{% tag %}` to call function tags

2025-11-07

How to prevent malicious collection of content in AnQiCMS and affect the exclusivity of front-end content?

Original content is the core value of the website, it condenses our thoughts, time and energy.However, the content has been maliciously collected, plagiarized, and published on other platforms, not only diluting the exclusivity of our content, but also potentially affecting the SEO performance of the website and even damaging the brand image.As website operators, we all hope that our front-end content can maintain its original exclusivity. 幸运的是,AnQiCMS was designed with this pain point in mind from the very beginning, incorporating multiple powerful features to help us effectively prevent content from being maliciously scraped and protect our original value. ### 1. Core Defense

2025-11-07

How to dynamically add a website name suffix to the page title to optimize SEO display?

In content operation, the page title is undoubtedly the first barrier to attracting the attention of search engines and users.A clear, keyword-rich, and brand-consistent title that not only improves user click-through rate but is also a key element of search engine optimization (SEO).AnQiCMS is an enterprise-level content management and SEO optimization system that provides a flexible and powerful mechanism, allowing you to easily add a website name suffix to the page title, thereby achieving a win-win situation for brand enhancement and SEO.### Unified Brand Image

2025-11-07

How to display the name and description of user groups in AnQiCMS template?

In AnQiCMS template, flexibly display user group names and introductions AnQiCMS, as an efficient content management system, provides great convenience for website operators with its "User Group Management and VIP System" function, which can easily achieve user classification, content permission control, and member value-added services. However, in actual operation, how to naturally present these carefully set user group information, such as their names and detailed introductions, in the website front-end template so that users can clearly understand their identity privileges or exclusive rights to various services is a problem that template developers and content operators often encounter.

2025-11-07