How to customize a flexible content model in AnQiCMS according to business needs to achieve personalized display?

Calendar 👁️ 72

In a rapidly changing network environment, website content is no longer just a pile of articles and images.Whether it is small and medium-sized enterprises showcasing diverse products and service cases, or self-media operators publishing event notices and in-depth reviews, it is required that the content be presented in a way that is most closely aligned with business logic and user needs.Traditional CMS often provides fixed content types, which are difficult to adapt to personalized needs, but AnQiCMS's flexible content model design exactly solves this pain point.

Why is a customized content model crucial for your business?

Imagine that your website needs to display:

  • a company'steam membersEach member has a name, position, introduction, avatar, and areas of expertise.
  • OneProduct details pageIn addition to the usual images and descriptions, it is also necessary to list the specifications in detail (such as size, material, color options), even a link to customer reviews.
  • OneEvent listEach activity includes the topic, time, location, registration method, speaker, and event poster, etc.

If relying solely on the general models of "article" or "product

The purpose of the custom content model is right here.It allows you to tailor data structures according to the unique properties of each business content.In this way, not only has the clarity and organization of content entry in the background improved, but the relevance between content has also become stronger. Moreover, when presented on the front end, it can accurately retrieve the required fields, realize a highly personalized and unified style layout, and greatly enhance the adaptability and user experience of the website.

Build and apply custom content models in AnQiCMS

AnQiCMS provides an intuitive interface for creating and managing these personalized content structures. The entire process is as simple as stacking building blocks.

1. Create or modify the content model

First, you need to enter the AnQiCMS admin interface, find the "Content Management" under the "Content Model" feature.Here you will see the system default built-in 'article model' and 'product model'.They are the foundation of your daily content posting, of course, you can also modify them according to your needs, but you cannot delete them.

To create a new content type, such as an “event” model, you need to click on “Add Model” and fill in some basic information:

  • Model nameThis is a Chinese name, such as 'event', 'team member', 'real estate information', used for identification and management in the back-end interface.
  • Model table nameThis is the table name stored in the database by the model, it needs to be a unique combination of lowercase English letters, the system will automatically suggest it for you, just keep the default, as it is closely related to the underlying logic of data storage.
  • URL aliasThis name will be reflected in the URL on the website front end, for example, if you create a "Event" model, its URL alias can be set aseventThen the event list page may be/event/list.htmlThis helps search engine optimization and user memory.
  • Title NameThis field will replace the default "Document Title" prompt, making it clearer for content entry personnel what the main content of the current model is, such as "Event Topic", "Product Name", or "Member Name".

2. Define model fields: The \

This is the most core part of the custom content model.When creating or modifying a model, you can add exclusive custom fields to the model.

  • Single-line text: Suitable for storing brief text information, such as \
  • Number: Used for storing numerical values, such as 'activity cost', 'product inventory', 'property area', for easy calculation or sorting.
  • Multi-line text: Suitable for storing long text descriptions, such as 'Activity Detailed Introduction', 'Team Member Introduction'.You can choose to enable the Markdown editor to achieve rich text editing, including inserting images, videos, even mathematical formulas and flowcharts, making the content richer.
  • Single choice: Use when you need to select one from several preset options, such as 'Activity Type' (online/offline), 'Property Use' (residential/commercial).
  • Multiple selections: Allow selection of one or more predefined options, such as "Product Features" (waterproof/dustproof/long battery life).
  • Drop-down selectionSimilar to single selection, but presented in a dropdown menu format, suitable for situations with more options, such as 'Product Color' (red/blue/green/black/white).

Each custom field needs to be set when created:

  • Parameter Name: This is the Chinese name displayed in the background interface and template, convenient for you to understand and call.
  • Field invocationThis is the English identifier called through the code in the template, it is recommended to use concise and clear English words.
  • Mandatory?Ensure that important information is not missed.
  • Default valueSet a default value for the field, especially suitable for selection fields, as an option list.

These flexible field combinations allow you to build the perfect "skeleton" for any complex business content.

3. Apply custom models to content publishing

After the model is defined, its role is reflected in content management.When you enter the 'Content Management' 'Add Document' interface and select a 'Category' associated with your custom model, something amazing happens—the page will automatically load and display all the custom fields you have defined for the model.

For example, if you select a category under the "ActivityThis enables content entry personnel to fill in information efficiently and accurately, greatly reducing the possibility of errors.

4. Implement personalized display in front-end templates

With structured content data, the next step is how to elegantly display them on the front end of the website.AnQiCMS uses a syntax similar to the Django template engine, allowing you to easily retrieve and render these custom data through rich template tags.

  • Get details of a single document (archiveDetail)When you are on the event details page, and need to display specific information of an event, you can usearchiveDetailLabel. For example, to display the "Activity Topic" field, if its "Call Field" isevent_title, you can write it like this:{% archiveDetail with name="event_title" %}For multiline text types (such as event descriptions), if you want the HTML content to be parsed correctly, don't forget to add|safeFilter:{{archiveContent|safe}}. If you need to cyclically display a list of images for a field (such as a multi-angle display of a product), and the "call field" of the custom field isproduct_images, then you can use:

    {% archiveDetail productImages with name="product_images" %}
    <ul class="product-gallery">
      {% for img in productImages %}
      <li><img src="{{img}}" alt="产品图" /></li>
      {% endfor %}
    </ul>
    
  • Get document list (archiveList) On the event list page, you may need to display the summary information of each event.archiveListTag in the loop, eachitemVariables will also include all custom fields. For example, display the title and location of each event:

    {% archiveList events with moduleId="您的活动模型ID" type="page" limit="10" %}
        {% for item in events %}
        <div class="event-card">
            <h3><a href="{{item.Link}}">{{item.Title}}</a></h3>
            <p>活动地点: {{item.event_location}}</p> {# 假设调用字段是 event_location #}
            <p>活动时间: {{stampToDate(item.event_time, "2006-01-02 15:04")}}</p> {# 假设调用字段是 event_time #}
        </div>
        {% endfor %}
    {% endarchiveList %}
    
  • Iterate over all custom parameters (archiveParams)Sometimes, you may need to dynamically display all custom fields and their values of a document in a general area without knowing the field names in advance.archiveParamsLabels come in handy:

    {% archiveParams params %}
    <div class="custom-fields">
        {% for item in params %}
        <p><strong>{{item.Name}}:</strong> {{item.Value}}</p>
        {% endfor %}
    </div>
    {% endarchiveParams %}
    

    This is very useful in the "Product specifications" area, where you do not need to manually list each parameter, the system will automatically display it.

By using these flexible template tags and filters, you can accurately control the display position, style, and content of page elements based on the data in a custom content model, truly realizing personalized display of website content.Whether it is to build a complex e-commerce website or an information-rich industry portal, AnQiCMS' content model can provide you with solid underlying support.

Summary

The flexible content model of AnQiCMS has opened up a new world in content management.It no longer confines your content to predefined frameworks, but instead gives you complete freedom to define various content types and their unique properties according to the actual business needs.

Related articles

How does AnQiCMS's high-concurrency architecture and static caching ensure the quick display of website content under high traffic?

## AnQiCMS: How can high concurrency and static caching ensure the rapid presentation of your website content?Under the current internet environment, the speed of website access directly affects user experience, conversion rate, and even search engine rankings.When website traffic surges, how to ensure that the content is still presented quickly and stably to visitors is a concern for every website operator.AnQiCMS Tackling this challenge, it provides a solid guarantee for the rapid display of website content through its unique high-concurrency architecture and intelligent static caching mechanism.

2025-11-08

How can the scheduled publishing feature ensure that content is automatically published and displayed on the website at a specific time?

## Say goodbye to the hassle of manual publishing: Anqi CMS scheduled publishing feature helps you accurately control the content going live time In today's rapidly changing online environment, content operators often face the challenge of publishing content at the right time.In order to coordinate with marketing activities, seize hot news, or simply to reach more audiences in different time zones globally, manual posting may bring many inconveniences and even miss opportunities.

2025-11-08

How do AnQiCMS traffic statistics and crawler monitoring data guide the optimization of content display strategies?

The success of website operation increasingly depends on a deep understanding of user and search engine behavior.It is not enough to simply post content; we need a mechanism to monitor the effectiveness of content and continuously optimize based on feedback.AnQiCMS (AnQiCMS) is well-versed in this, with its built-in traffic statistics and crawler monitoring functions, which are powerful 'data compasses' for refining our content strategy and enhancing website performance.We all know that content is the cornerstone of a website, and how to make this content seen by more people and achieve better interaction is the core of operation.

2025-11-08

How do user groups and VIP systems control access permissions and display status for different users to specific content?

An enterprise CMS provides us with a powerful and flexible user group and VIP system, not only to distinguish between ordinary users and members, but also to manage the website content in a fine-grained manner, allowing different user groups to see different information, and even to determine whether they can access certain specific content based on their level.This is a very important feature for websites that operate paid content, provide exclusive member services, or customize browsing experiences based on user identity. ### User groups and VIP system, what can they do for us?

2025-11-08

How does the modular design of AnQiCMS support the independent upgrade and display expansion of front-end feature points?

AnQiCMS is favored in the field of website operation largely due to its exquisite modular design.This design not only makes the system itself efficient and stable, but more importantly, it provides powerful and flexible support for the independent upgrade and display expansion of front-end feature points, allowing content operators to have more freedom to control the presentation style and development path of the website.

2025-11-08

How to use the Go language features of AnQiCMS to implement the rapid loading and smooth display of website front-end content?

In today's rapidly changing digital age, the loading speed of websites and the smooth display of content have become key indicators of user experience and SEO performance.AnQiCMS (AnQiCMS) leverages its powerful genes based on the Go language to provide solid technical support for the rapid loading and smooth display of website front-end content.Go language is renowned for its exceptional performance and concurrent processing capabilities.As a compiled language, Go code is efficiently converted into machine code before execution, which means the program has extremely high execution efficiency.

2025-11-08

How to ensure UTF-8 encoding when creating AnQiCMS templates to avoid garbled front-end pages?

When using AnQiCMS to build a website, ensure that the front-end pages display normally and avoid annoying garbled characters, which is an important detail that every operator needs to pay attention to.Where, the character encoding of the template file is a key point.If the encoding setting of the template file is incorrect, even if the content of the website itself is not a problem, the page that ultimately appears to the user may be a bunch of unrecognizable characters.

2025-11-08

How does AnQiCMS's adaptive, code adaptation, and PC+Mobile independent mode affect the display effect of the website on different devices?

In today's multi-screen interconnected era, whether a website can display smoothly and efficiently on different devices is directly related to user experience and brand image.AnQiCMS is a rich-featured enterprise-level content management system that fully understands this, providing users with three flexible website display modes to meet the diverse needs of device access: adaptive, code adaptation, and PC+Mobile independent mode.Understanding the working principles and their impact on the display effects of websites is crucial for operators.

2025-11-08