How to use AnQi CMS to customize article model fields for personalized content display?

Calendar 👁️ 54

In Anqi CMS, the flexibility of the content model is one of its core strengths. It not only helps us manage traditional articles and product information, but also allows us to create highly personalized content types according to actual business needs.And customizing the article model fields is the key step to achieving this personalized display.

The essence of content operation is to provide users with the information they truly need and present it in the most intuitive and attractive way.Imagine if your website needs to display movie reviews, in addition to the movie title and synopsis, you may also need special fields such as "director", "starring", "release date", "rating", and so on.If it is a real estate website, in addition to the basic introduction, you would hope to have information such as 'floor plan', 'area', 'orientation', 'price range', and more.The customized model field function of Anqi CMS is specifically designed to meet these diverse content needs.

Deep understanding of content model and custom fields

In Anqi CMS, the content model is like a "blueprint" or "structure definition" for the content of your website.The system provides the two basic models of 'article' and 'product' by default, but often this is far from meeting the unique business needs.Custom fields allow us to add exclusive "details" to these blueprints, making the content more structured and expressive.

Why do we need it?

  • Structured data:Let every piece of content have a unified and standardized data structure, convenient for management and retrieval.
  • Personalized display:Display the unique properties of different types of content to enhance user experience.
  • Efficient operation:When editing content on the back end, just fill in the corresponding fields to reduce manual formatting and repetitive work.
  • Strong extensibility:Lay a solid foundation for future feature expansion (such as filtering, search, etc.)

Create and manage custom model fields

In Anqi CMS, the process of managing custom fields is intuitive and efficient.

  1. Enter content model management:Log in to the Anqi CMS backend, navigate to the 'Content Management' menu, and click 'Content Model'.Here you will see a list of all content models created, including built-in and customized ones.

  2. Select or create a model:

    • Edit the existing model: If you want to add more fields to the 'Article' or 'Product' model, simply click the 'Edit' button on the right side of the corresponding model.
    • Create a custom model:If you need a completely different type of content (such as "events", "recruitment", etc.), you can click on "Add Content Model".When creating, you need to set the "model name", "table name" (recommended in lowercase English), "URL alias", and the "title name" displayed when publishing content.These are the metadata of the model.
  3. Add custom field:After entering the model editing page, scroll down to find the "Custom field" area of the content model.This is the place for defining content-specific attributes. Click 'Add field' to define your personalized content attributes:

    • Parameter name:This is the Chinese name displayed in the background for editors, such as 'Film Director', 'Property Area'.
    • Call field: This is the most important part!It is the unique identifier that is called to retrieve the value of this field in the template, make sure to use lowercase English letters. For example, if you define "director", the field to be called can bedirectorIf defined, 'release date' can berelease_date.
    • Field type:Anqi CMS provides various field types to adapt to different data:
      • Single-line text:Suitable for brief text information, such as "brand", "model".
      • Number:Only numbers are allowed, such as "price", "stock".
      • Multi-line text:Suitable for longer descriptive text, such as 'Detailed introduction', 'Cautionary notes'.
      • Single choice/Multiple choice/Dropdown choice:Applicable to preset options, such as 'Red, Blue, Green', 'Apartment Type (One-bedroom, Two-bedroom, Three-bedroom)'. Enter each option on a separate line in the 'Default Value'.
    • Mandatory?:Set according to the importance of the content to ensure that key information is not missed.
    • Default:Set default values for fields, which can be used or modified directly during editing.

    After defining the field, remember to click save.

Enter personalized content data

After you add custom fields in the content model, these fields will automatically appear in the content publishing and editing interface.

  1. Publish or edit documents:Enter "Content Management" under "Publish Document", or edit an existing document.
  2. Select the corresponding category:Make sure the "category" you choose is based on the content model you modify or create. Only then will the corresponding custom fields be displayed.
  3. Enter "other parameters":At the bottom of the document editing page, there is usually a collapsed area called 'Other Parameters'.Expand it and you will find that all the custom fields you just created are neatly arranged here, just fill in the data according to the prompts.

Display personalized content in the template

The value of the custom field ultimately manifests in the personalized display on the front-end page.The AnQi CMS template system supports Django template engine syntax, using its powerful tags and filters, you can easily display these custom data to users.

  1. Invoke a single custom field:If you want to display a specific custom field in the content detail page (for examplearchive/detail.html) such as "Film Director", you can usedirector)archiveDetailTags:

    <p>导演:{% archiveDetail with name="director" %}</p>
    

    here,name="director"This corresponds to the "trigger field" you set up in the background. The system will automatically retrieve the current document'sdirectorfield value and display it. You can also assign it to a variable for further use:

    {% archiveDetail movieDirector with name="director" %}
    {% if movieDirector %}
        <p>导演:{{ movieDirector }}</p>
    {% endif %}
    
  2. Loop to display all custom fields:In some cases, you may want to display all non-empty custom fields in a single area or present them in a list. At this point,archiveParamsThe tag can be put to use, it can get the collection of all custom fields in the current document and output them through a loop:

    <h3>电影参数</h3>
    <ul>
    {% archiveParams params with sorted=true %} {# sorted=true 保持后台定义顺序 #}
        {% for item in params %}
            {# 假设有些字段您不希望显示,可以这样排除 #}
            {% if item.Name != '内部备注' %}
                <li>{{ item.Name }}:{{ item.Value }}</li>
            {% endif %}
        {% endfor %}
    {% endarchiveParams %}
    </ul>
    

    Hereitem.NameIt will display the field

Related articles

How to use the AnQiCMS content model feature to customize

In AnQiCMS, the content model feature is one of its core highlights, it gives the website great flexibility, allowing you to break free from the constraints of traditional CMS fixed content types, and customize exclusive content structures according to your business needs.Imagine if your website is not just for publishing articles or products, but also needs to display real estate information, job openings, event details, and even recipes. If you use a fixed 'article' type, these pieces of information will be difficult to organize and manage.And the content model is the powerful tool to solve this pain point.### Understand the content model: the "skeleton" of website content In simple terms

2025-11-08

How does AnQiCMS support switching and displaying multilingual content to reach global users?

In today's digital age, websites are no longer just information发布 platforms for local markets, but are also important windows for reaching global users and expanding international business.To meet the language needs of users from different countries and regions, it is crucial to build a website that supports multilingual content.AnQiCMS, as an efficient content management system, is designed to meet this challenge. It provides a complete solution to help users easily switch and display multilingual content. AnQiCMS

2025-11-08

How does AnQiCMS manage and display content for multiple independent sites?

In today's increasingly refined digital marketing era, companies and individuals often need to manage multiple independent sites to meet the content display needs of different brands, regions, or business lines.AnQiCMS was born to address this challenge, with its powerful multi-site management capabilities, allowing content operators to easily navigate the complex multi-site ecosystem.### AnQiCMS Multi-site Management Concept and Advantages AnQiCMS has always fully considered the needs of users for multi-site management in its design, aiming to provide a simple and efficient solution

2025-11-08

How to optimize the URL structure of the AnQiCMS website to make it more search engine friendly?

The importance of website URL structure is often undervalued, but it has a profound impact on search engine optimization (SEO) and user experience (UX).A clear, concise, and meaningful URL that not only helps search engines better understand the page content, improve crawling efficiency and ranking, but also allows users to have an expectation of the page content before visiting, thereby enhancing trust and click-through intention.AnQiCMS (AnQiCMS) understands this and provides powerful and flexible tools to easily optimize the URL structure of your website.###

2025-11-08

How to configure multilingual content switching in AnQiCMS to support browsing by users from different countries?

Today, with the deepening of globalization, it is a crucial step to allow your website to support multiple languages and reach users in different countries, expanding the market and enhancing brand influence.AnQiCMS (AnQi CMS) fully considered this requirement at the initial design, providing users with an efficient and flexible multilingual content switching solution.AnQiCMS is at the core of implementing multilingual content switching, with its powerful **multi-site management** function, supplemented by **default language package** configuration, and the flexible application of **front-end template tags**

2025-11-08

How to set up a static URL structure for the article detail page in Anqi CMS to optimize SEO?

In website operation, a clean and readable URL structure is crucial for search engine optimization (SEO).A pseudo-static URL, as the name implies, refers to those URLs that look like static HTML pages but are actually generated by backend dynamic programs.This URL can preserve the flexibility of dynamic content management, provide a friendly crawling path for search engines, and also improve the user experience, making it easier for them to understand the page content.

2025-11-08

How to implement the document list page of AnQi CMS to filter and display pages according to the specified category ID?

Manage and display a large amount of content in Anqi CMS, especially when it is necessary to organize content by specific categories and display it with pagination, understanding its template tags and structure is crucial.Anqi CMS with its flexible template engine enables content operators to easily meet these requirements, providing users with a clear and efficient browsing experience.Why do you need to filter by category and paginate?Imagine a website with hundreds or even thousands of documents, if all the content is stacked on a single page, users will be at a loss and the website's loading speed will be affected.

2025-11-08

How does AnQiCMS ensure that website content is displayed efficiently under high concurrency requests?

Under high traffic access, the smooth display of website content is a core issue that every operator is extremely concerned about.How to ensure that the content is presented quickly and stably in front of users when a large number of users flood into the website at the same time, this not only tests the carrying capacity of the website server, but also deeply depends on the underlying architecture and optimization strategy of the content management system.AnQiCMS (AnQiCMS) was designed with 'high concurrency' as one of its core advantages, providing a solid guarantee for the efficient display of content under high concurrency requests through a series of technical highlights and operational support.

2025-11-08