How to use the flexible content model of AnQi CMS to customize the display structure of content?

Calendar 78

Unlock content potential: Utilize AnQi CMS flexible content model to customize display structure

In today's rapidly changing digital world, website content is no longer just simple articles and pages.For many operators, it may include a variety of products, engaging activities, professional and detailed project cases, and even unique team member introductions.Traditional Content Management Systems (CMS) often use fixed content structures, causing diverse information to be crammed into the boxes of "title" and

AnQi CMS was born to solve this pain point. It provides an extremely flexible content model, allowing us to customize the structure and display of each type of content according to actual business needs, just like building with blocks.This is not just the convenience of background data entry, but also a revolutionary improvement in the front-end content presentation effect.

Why is the content model so important?

Imagine you are running an e-commerce website. Traditional CMS might only give you a 'product title' and 'product description' input box.But in fact, a product may also require multiple attributes such as 'price', 'inventory', 'brand', 'model', 'color', 'size', 'material', and more.If this information is all stuffed into the "Product Details", it not only makes management chaotic, but also makes it difficult for users to quickly obtain key information.

Flexible content models allow you to create dedicated data fields for different types of content, just like customizing a set of 'IDs' for each type of content. For example:

  • Product content: Can have fields such as 'price', 'SKU', 'brand', 'image set', 'product specifications', etc.
  • Event content: Can include fields such as "Event Date", "Event Location", "Application Deadline", "Keynote Speakers", etc.
  • Project Case: You can define fields such as "Customer Name", "Industry Field", "Problem Solved", "Implementation Effect" and so on.

This customized content structure can help your website display information more clearly and logically, improve user experience, and even have a positive impact on search engine optimization (SEO), because structured data is easier for search engines to understand and index.

How to implement content model customization in Anqi CMS?

In AnQi CMS, the customization experience of the content model is very intuitive.You can find the 'Content Model' feature through the 'Content Management' on the backend.The system is built-in with "Article Model" and "Product Model", but you can create a new custom model as needed.

Taking the creation of a 'Project Case' model as an example, we need:

  1. Define basic model information: Give the model a recognizable "model name" (such as: project case), and set a "model table name" for database storage and a "URL alias" for URL construction (usually in lowercase English letters).
  2. Add custom fieldThis is the core of the content model. You can add a series of exclusive fields for "project case", such as:
    • Parameter Name(For example: "Customer Name"): This is the friendly name displayed in the backend interface for content editors.
    • Field invocationFor example: "clientName" is the unique identifier used when calling this field in the template. It is recommended to use camelCase naming style.
    • Field type: Anqi CMS offers a variety of field types to match your data needs:
      • Single-line text: Suitable for brief text information, such as 'customer name', 'industry field'.
      • NumberApplicable to numeric data, such as 'project budget', 'completion cycle'.
      • Multi-line textApplicable to longer descriptive text, such as 'pain points solved', 'customer reviews'.
      • Single choice/Multiple selections/Drop-down selection: Data applicable to preset options, such as "Project Status" (in progress/completed), "Type of Collaboration" (B2B/B2C).You can provide a specific list of options in the "default value", one option per line.
    • Mandatory?You can set certain fields as required based on importance to ensure the completeness of the content.

After defining the model and fields, the next step is to apply these models to your content.When creating a "document category", you can choose to bind the category to a specific content model (for example, bind the "project case" category to the "project case" model).This, all the content under this category will follow the field structure defined by the 'project case' model for entry.

Present custom content on the website front end.

After customizing the content model, how to elegantly display this information on the website front-end is the key to personalized display.AnQi CMS adopts the Django template engine syntax, allowing you to easily call these custom fields in template files.

Firstly, you need to understand the organization structure of the template file. The template files of AnQi CMS are usually stored in/templatedirectory, and classified according to the model or page type (for example,{模型table}/detail.htmlUsed to display the details of the model under this model).

When you need to display custom model fields, you can usearchiveDetailandarchiveParamsthese two tags:

  • archiveDetailTagUsed to get detailed information about the current document, including all custom fields. You can directly call by field name. For example, on the detail page of "Project Cases"project/detail.htmlIn Chinese, if you define the 'Customer Name' (called fieldclientName) and the 'Industry Field' (called fieldindustry), you can display them like this:

    <h1>{{ archive.Title }}</h1> {# 默认标题字段 #}
    <div>
        <strong>客户名称:</strong> {% archiveDetail with name="clientName" %}<br>
        <strong>行业领域:</strong> {% archiveDetail with name="industry" %}<br>
        {# 假设还有一个多行文本字段 'solution' #}
        <strong>解决方案:</strong> {% archiveDetail solution with name="solution" %}{{solution|safe}}<br>
    </div>
    <div class="project-content">
        {{ archive.Content|safe }} {# 默认正文内容,记得使用 |safe 防止HTML转义 #}
    </div>
    
  • archiveParamsTagIf you want to loop through all custom fields, or are unsure of the specific field names,archiveParamsIt will be very useful. It will return an array containing all custom parameters, and you can iterate through this array to display.

    <div>
        <h3>项目参数:</h3>
        {% archiveParams params %}
        <ul>
        {% for item in params %}
            <li><strong>{{ item.Name }}:</strong> {{ item.Value }}</li>
        {% endfor %}
        </ul>
        {% endarchiveParams %}
    </div>
    

    This method is particularly convenient when you need to dynamically add or modify model fields without frequently modifying the template.

For fields like 'Multiple Choice' or 'Dropdown Selection' that may return multiple values, you would typically retrieve them as an array and iterate over them in the template to ensure that all options are clearly displayed.

Practical Tips for Optimizing Content Display

Based on custom content structure, Anqi CMS also provides other features to further optimize content display and user experience:

  1. Custom URL static rulesThrough the 'static rule' setting on the backend, you can customize more semantically meaningful and SEO-friendly URL structures for different content models, categories, or documents. For example, set the URL of the detailed page of 'project cases' to be/projects/{filename}.htmlit is no longer simple/article/{id}.htmlThis not only improves user memorability, but also helps search engines better understand the content of the page. You can make use of{module}/{filename}etc. to flexibly construct URLs.

  2. Category template and document templateWhen certain categories or individual documents require a completely different layout or display style, Anqi CMS allows you to specify exclusive template files for them. For example, to specify a template for the "Recruitment Information" category,job/list.htmlA template that allows the list page to display key information such as job salaries, locations, etc.; or specify for an important "About Us" single pagepage/about_us.htmlTemplate, with a unique visual design. This brings the personalized display of content to its peak.

  3. Multilingual content displayIf your website is aimed at international users, the multilingual support feature of AnQi CMS can be perfectly combined with the content model. You can define corresponding fields for different language versions in the content model and throughlanguagesThe label provides language switching options on the front end, ensuring that users in different regions can see content that conforms to their habits.

Conclusion

The flexible content model of AnQi CMS brings unprecedented freedom to your website content management. It frees you from the constraints of traditional CMS, enabling you to precisely define and display each type of content, thus creating

Related articles

How to implement unified management and display of multi-site content in AnQiCMS?

Managing multiple websites can be a headache, as each site requires a separate system to maintain, which not only consumes a lot of time and effort but may also lead to a lack of consistency in brand image, delayed content updates, and difficulties in centralized data analysis and SEO optimization.Imagine if you could easily manage all the content of sites from a single backend and flexibly control their display, how efficient that would be!AnQiCMS is born to solve such pain points.It is not simply to allow you to run multiple independent CMS on the same server, but to provide a centralized solution that enables you to maintain a unified

2025-11-07

How to efficiently display the AnQiCMS article list and support multiple sorting, filtering, and pagination methods?

Efficiently display article lists in AnQiCMS and support various sorting, filtering, and pagination methods, which is the core link of content management.Understanding the flexible application of template tags can help you build highly customized and user-friendly content display pages. To achieve this goal, we mainly rely on the powerful template tag system of AnQiCMS, especially the core **`archiveList` tag**,配合**`pagination` tag** and various auxiliary filters and logical controls.### One, Core

2025-11-07

Does AnQiCMS support Json-LD structured data output and how to customize its content?

AnQiCMS support for Json-LD structured data, as well as how to customize its content, is a frequently discussed issue by many users concerned about website SEO performance.As a system dedicated to improving content management efficiency and SEO optimization, AnQiCMS provides flexible and powerful functions in this aspect. ### AnQiCMS supports native Json-LD structured data Firstly, AnQiCMS indeed supports Json-LD structured data output.

2025-11-07

How to call and display the TDK (title, keywords, description) information of the page in AnQiCMS template?

In website operation, TDK (Title, Keywords, Description) information plays a crucial role, directly affecting the visibility and click-through rate of the website in search engines.As the "business card" displayed on the website, the reasonable setting of TDK is the foundation of SEO optimization.AnQiCMS as a content management system focusing on SEO optimization naturally provides users with flexible and powerful TDK management and call functions.

2025-11-07

How can AnQi CMS support the switching and correct display of multilingual content?

Today, with the increasing globalization, it is crucial for website content to reach users in different languages.AnQi CMS understands this need and provides a powerful and flexible multilingual support feature to help us easily achieve content internationalization switching and correct display. ### Core Concept and Basic Configuration AnQi CMS has a clear hierarchical design in multilingual processing.It distinguishes the translation of system-built-in text, custom template text translation, and the organization and display of actual content.This allows us to flexibly respond to multilingual needs in different scenarios. First

2025-11-07

How do the static and 301 redirect features enhance the visibility of website content in search engines?

When we post content on the Internet, one of our core desires is to have these contents seen by more people.Search engines, as the main entry point of information, have naturally become the 'battlefield' we all compete to optimize.Among the many strategies to improve a website's visibility in search engines, static URL and 301 redirect are two seemingly basic features that actually have a profound impact.For users of Anqi CMS, a deep understanding and good use of them can bring significant advantages to the website.

2025-11-07

What help does the content collection and batch import function of AnQi CMS provide for content display?

In today's highly competitive digital world, the richness and timeliness of website content are often the key to attracting and retaining visitors.However, consistently producing or organizing a large amount of high-quality content is a huge challenge for many operators.Fortunately, advanced content management systems like AnQiCMS are providing us with an efficient solution through their unique content collection and batch import functions.This is not just a reduction in workload, more importantly, it has brought a qualitative leap in the display effect of our website content.### Say Goodbye to Complexity

2025-11-07

Advanced SEO tool (Sitemap, TDK, Robots.txt) how to optimize content display effect?

In website operation, it is the common pursuit of everyone to present our content better in front of search engines and users.AnQiCMS provides a series of powerful advanced SEO tools, among which Sitemap, TDK (Title, Description, Keywords), and Robots.txt are the key to optimizing the display effect of content.These tools are like providing a detailed map and guide for search engines to help them understand and display our website content more efficiently and accurately.

2025-11-07