How to use AnQiCMS's 'Flexible Content Model' to customize the display structure and fields of articles, products, and other content?

Calendar 👁️ 69

The secret of AnQiCMS content model: Create a unique content display structure for you

In the world of content management, website content is not monotonous.The structure and fields of a blog article, an e-commerce product page description, or the presentation of corporate event information are often quite different.The traditional CMS system may only provide fixed article or page templates, and once the business requirements change, the website becomes inadequate and difficult to respond flexibly.However, AnQiCMS solves this pain point with its 'flexible content model' feature, allowing you to deeply customize the display structure and fields of website content according to your actual business needs, thereby achieving more accurate and personalized content management.

Why is the content model so important?

Imagine that if you run a real estate website, in addition to the basic 'article title' and 'article content', you also need to add special fields such as 'apartment type', 'area', 'orientation', 'price', 'location', etc. for each property.If you only rely on traditional rich text editors to fill in this information, not only is the data entry efficiency low, but worse still, when users browse, these key pieces of information will be lost in a sea of text and will be difficult to grasp at a glance.Furthermore, search engines also cannot understand these unstructured data very well, which affects the SEO performance of the website.

The flexible content model of AnQiCMS was born to solve these problems.It allows you to create dedicated data structures for different types of content, just like building blocks.This means you can:

  • Achieve precise classification and management of content:Separate content of different nature (such as articles, products, services, cases, activities, etc.) clearly, each type of content has its unique set of properties.
  • Improve content entry efficiency:Content editors only need to fill in the information according to the preset fields, avoiding format confusion and missing key data, greatly improving work efficiency.
  • Optimizing user experience: Visitors to the website can quickly locate and filter the information they are interested in, making the content display more organized and professional.
  • Enhance SEO performance:Structured data is easier for search engines to understand and crawl, which helps improve the search ranking of a website.

AnQiCMS's 'Flexible Content Model': From Concept to Practice

How exactly do we use this powerful feature to customize content in AnQiCMS?

First, you need to enter the AnQiCMS administrative interface.Under the 'Content Management' module in the sidebar, you will find the 'Content Model' option.AnQiCMS provides the "article model" and "product model" as two basic content models by default, which can be used as a starting point for creating new content types or can be directly modified.

Field customization: Inject vitality into your content

Click on any content model (or create a new model), and you will see the field list included in the model.This is the core area for customizing the content structure. You can add unique custom fields to the model, each carrying specific information.

When adding or editing fields, there are several key settings that we need to pay attention to:

  • Parameter name (display name):This is the field name displayed in the background content editing interface, it should be clear and understandable for the content editor. For example, 'author', 'product price', 'house area', etc.
  • Call field:This is the unique identifier used to call the field content in the template.it must be english lowercase letters, and unique throughout the site, because the template is used to retrieve and display data through this identifier.For example, you set the parameter name to "author", then the "field called" can beauthor.
  • Field type:AnQiCMS offers various field types to adapt to different data formats:
    • Single-line text:Suitable for short text information, such as "author name", "brand name".
    • Number:Suitable for numerical data, such as "price", "inventory quantity", "room number".
    • Multi-line text:Suitable for scenarios requiring longer text descriptions, such as "product features", "detailed introduction".
    • Single choice:Provide multiple preset options, but only one may be selected, for example, 'Color' (red, green, blue).
    • Multiple selection:Provide multiple preset options and allow multiple selections, such as "Product Features" (waterproof, dustproof, fast charging).
    • Dropdown selection:Similar to single selection, presented in a dropdown menu format to save space, such as "Origin", "Size".
  • Mandatory?:You can set whether this field is required to be filled in when content is published, which helps to ensure the completeness and standardization of the content.
  • Default:Set a default value for the field, which can be automatically filled in when creating content, further improving efficiency, especially for single-choice, multiple-choice, and dropdown selection types of fields, where it will be used to define the optional option values.

By combining and configuring these fields, you can build almost limitless display structures for different types of content.For example, add fields such as 'activity time', 'location', and 'registration link' to the 'activity' model;Add fields such as 'duration', 'instructor', 'target audience', and others to the 'course' model.

Content Entry: The Stage of Custom Fields

When you add or edit articles, products, or any other content created based on a custom content model in the background, in addition to the regular title, content editor, categories, and other options, you will see all the customized custom fields for that model in the "Other Parameters" area.The content editor simply needs to fill in the information here step by step, and the system will perform the corresponding verification and storage based on the field type, the whole process is intuitive and efficient.

Template Invocation: Let the Content Model Present Gracefully on the Front End

The backend content model and field settings are all for the purpose of displaying on the website front end.AnQiCMS template tag system perfectly connects background data with front-end display.

In the template file, you can call the data of the custom fields in the following way:

  1. Directly call specific fields:If you know the name of the custom field's "reference field" directly, you can use it.{{archive.你的调用字段名}}This method to get. For example, if your article model has customizedauthorField, then in the article detail page template, you can display the author like this:

    <p>作者:{{archive.author}}</p>
    

    For the product model, if you have customizedpriceField, then you can display it like this:

    <p>价格:{{archive.price}} 元</p>
    
  2. Loop through all custom fields:Sometimes, you may want to dynamically display all custom fields, or be unsure of the specific field names of each content. AnQiCMS providesarchiveParamsThe tag allows you to loop through all the custom fields of the current content model and display their "parameter name" and "parameter value" one by one.

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

    This method is especially useful in scenarios such as displaying product parameter lists, service details, etc., as it can automatically adapt to the increase or decrease of backend fields without frequent modification of frontend code.

Through these flexible

Related articles

How to display a specific prompt to the visiting user when AnQiCMS is in shutdown mode?

During the use of the AnQiCMS website management, we occasionally encounter situations where we need to temporarily shut down the website, such as system upgrades, content maintenance, or data migration, etc.How can one clearly display specific prompts to the visiting user at this time, rather than a cold error page, which is particularly important.Our AnQi CMS is well-versed in this, providing us with a very user-friendly shutdown prompt function that allows the website to maintain a professional image even when temporarily 'resting'.Why do we need customized exit pop-ups?Imagine

2025-11-09

How to adjust the default language package of AnQiCMS website to adapt to different user interface display text?

In daily operations, you may wish to have the AnQiCMS website's backend management interface, system messages, or some built-in display text presented in different languages to better adapt to the working habits of team members or specific operational needs.AnQi CMS fully considers the needs of global operation and provides a convenient and quick way to adjust the default language package of the website.This feature not only makes your background operation smoother, but also lays a foundation for multilingual promotion. Adjust the AnQiCMS website's default language package, it is very intuitive.

2025-11-09

How to set the copyright information and filing number of the website in AnQiCMS and display them uniformly in the footer?

In website operation, the copyright information and filing number at the bottom (footer) of the website are not only a reflection of the professionalism of the website, but also an important part of legal compliance.For websites built with AnQiCMS, setting and displaying these information uniformly is a simple and direct process.This guide will help you easily complete these configurations in AnQiCMS, making your website look more professional and credible.### Step 1: Set copyright information and record number in AnQiCMS backend AnQiCMS provides a centralized management interface

2025-11-09

How to configure the mobile end website address of Anqi CMS to ensure that the content is displayed adaptively on mobile phones?

In today's mobile internet era, the display effect of websites on mobile phones is directly related to user experience and content dissemination efficiency.For users of AnQiCMS, ensuring that content is presented elegantly on various mobile devices is an indispensable aspect of content operation.AnQi CMS provides flexible configuration options and template mechanisms to help you easily achieve this goal.### Overview of AnQi CMS Mobile Adaptation Strategy From the beginning of its design, AnQi CMS has considered the need for multi-terminal access and therefore provides three main website modes to adapt to mobile display

2025-11-09

How to extract the article title and display an ellipsis in Anqi CMS template?

In AnQi CMS template development, it is often encountered that article titles need to be displayed on the list page, but in order to ensure the beauty of the layout and unified layout, long titles need to be truncated and abbreviated with an ellipsis.This has improved the user experience and also made the page look cleaner and more professional.AnQi CMS with its flexible Django template engine syntax makes it very direct and efficient to implement this requirement.

2025-11-09

How to safely extract the content of an article containing HTML tags without destroying its structure?

In website content management and display, we often need to display the partial content of articles in article lists, homepage summaries, or related recommendation areas to attract readers to click.However, directly truncating the content of an article containing HTML tags can easily disrupt the original HTML structure, causing the page to display incorrectly and even affecting the overall layout and user experience.AnQiCMS (AnQiCMS) fully understands this pain point, its powerful template engine and built-in filters provide an elegant and secure solution, allowing you to worry-free about display issues caused by content truncation. Next

2025-11-09

Extract the article summary by word count instead of character count, which filter should be used in the template?

In website content operation, the way articles are presented often directly affects readers' click intentions and reading experience.A clear and concise summary that helps readers quickly understand the main theme of the article.Especially in scenarios such as list pages and recommendation areas, we usually hope that the abstract can be intelligently extracted, controlling the length while maintaining readability.When it comes to generating abstracts based on the content of an article, the length of the excerpt is a core consideration.There are two common ways to truncate: by character count and by word count.Cutting by character count is accurate, but it often encounters the situation where words are abruptly cut off

2025-11-09

How to prevent XSS attacks and correctly escape HTML special characters when outputting article content in a template?

Managing and displaying content in AnQiCMS is the core task of website operation, but it is also crucial to ensure that these contents are presented safely and securely to users.Among them, cross-site scripting (XSS) attacks are a risk that should not be ignored, which may allow malicious code to be executed in the user's browser accessing your website, thereby triggering a series of security issues, such as stealing user data, tampering with page content, and even hijacking user sessions.

2025-11-09