How to extend content display options through custom fields in AnQiCMS?

Calendar 👁️ 75

Today, with the increasing refinement of content operation, the display method of website content is no longer just a simple title and text that can meet all needs.Whether it is to display product detailed parameters, registration information for events, or record the professional background of team members, we need a more flexible and structured content management approach.AnQiCMS (AnQi Content Management System) is exactly where it provides strong support, through its 'Custom Fields' feature, it helps us easily expand content display options, creating a highly personalized website experience.

Why do content display options need to be more flexible?

Imagine if we were to manage an e-commerce website, in addition to product names and descriptions, we would also need to display specific information such as color, size, material, inventory, origin, and a series of other details.If relying solely on piling up these data in the text, it not only leads to chaotic layout but also makes it difficult for users to quickly obtain the required information. It is also very inconvenient to manage on the backend and cannot be filtered or searched according to these properties.

AnQiCMS deeply understands this requirement, its 'flexible content model' design is exactly to solve the pain points of the solidified content structure of traditional CMS.It allows us to break out of the established frameworks of 'articles' and 'products', defining a set of exclusive, customizable fields for each type of content based on business logic, making the content more structured and providing endless possibilities for front-end display.

Content Model and Custom Fields in AnQiCMS

In AnQiCMS, custom fields exist依附于 the "content model".The system is preset with two commonly used models, 'Article Model' and 'Product Model', but its core highlight is that we can completely create new content models or extend existing models.

Log in to the "Content Management" section of the AnQiCMS backend, find the "Content Model" option, which is the core area for defining the content skeleton.We can see that each model has a series of basic attributes, such as model name, model table name (for database storage), URL alias, and so on.That which truly gives life to the content is the freely configurable 'custom fields' under each model.

How to Create and Configure Custom Fields

The process of creating a custom field is very intuitive. When editing or creating a new content model, we can add exclusive fields to the model.Each custom field needs to clearly define the following key properties:

  • Parameter name:This field shows the name displayed to the operator when editing content in the background management interface, such as 'Product Color', 'Event Date', 'Author Position', etc., and should be clear and easy to understand.
  • Call field:This is the unique identifier stored internally in the system and called in the template, usually it is recommended to use alphabets, likecolor/event_date/author_position. The template retrieves the corresponding data through this name.
  • Field type:AnQiCMS provides various field types to meet different data format requirements:
    • Single-line text:Suitable for brief text information, such as product models, one-line introductions.
    • Number:Ensure the input data is purely numeric, suitable for prices, inventory, quantities, etc.
    • Multi-line text:Suitable for long text descriptions, such as product features, author biographies, and even can be combined with Markdown editors to achieve rich text content.
    • Single choice, multiple choice, dropdown choice:These three types are very suitable for preset option content, such as product colors (red, green, blue), activity types (online, offline), or user permission levels, etc.We can pre-set the default values of the options, so the user just needs to check or select, which avoids errors and irregularities caused by manual input.
  • Mandatory?:Determine whether the user must fill in this field when publishing content to ensure the integrity of key information.
  • Default:Provide default values for the field to facilitate quick filling in by the user or as a fallback if not filled in.

By these flexible configuration options, we can tailor data structures for any type of content.For example, add fields such as 'house type', 'area', 'orientation', 'floor' and others to the 'real estate' model;Add fields such as "start time", "teacher", "tuition fee", "enrollment targets", etc. to the "Education Course" model.

Apply custom fields in content

Once the content model is defined and custom fields are added, these fields will be reflected on the backend document (article, product, etc.) editing page.They usually appear in the "Other Parameters" collapsible area, convenient for content editors to fill in.

When we are editing a "product" content, in addition to filling in the title and main description, we will also see input boxes for custom fields such as "product color", "product size", and so on.The editor only needs to fill in the corresponding data according to the actual situation.This structured input method not only makes content management more organized, but also greatly improves the efficiency and accuracy of content publishing.

Flexible display: How to call custom fields in the template

The value of the custom field is ultimately reflected in the flexible display on the front-end page.AnQiCMS uses a template engine syntax similar to Django, making it very convenient to call custom field data in templates.

For document (archive) or category (category) content, we can call custom fields in two main ways:

  1. Directly call specific fields:If you know the name of the custom field's 'calling field' (for exampleauthor/price), you can use it directly{% archiveDetail with name="author" %}or{{archive.author}}(IfarchiveIs the variable for the current content to get its value. This method is suitable for scenarios where it is necessary to display a specific custom field accurately. For example, displaying the author's name of a blog post:

    <p>作者:{% archiveDetail with name="author" %}</p>
    

    Or display the product price on the product detail page:

    <p>产品价格:¥ {% archiveDetail with name="price" %}</p>
    

    If the custom field is multiline text and you want it to parse Markdown to HTML, you can combinerenderFilter:

    <div>作者简介:{% archiveDetail authorIntro with name="author_intro" %}{{ authorIntro|render|safe }}</div>
    
  2. Loop through all custom fields:When the content model has multiple custom fields and you want to dynamically display all parameters in a list or table form,{% archiveParams %}The label is very useful. It returns an array object containing all custom field names and values, which we can iterate over in the template.This is very efficient for generating product parameter lists or member information cards, without manually listing each field.

    <div class="product-specs">
        <h3>产品参数</h3>
        <ul>
            {% archiveParams params %}
            {% for item in params %}
            <li>
                <strong>{{item.Name}}:</strong>
                <span>{{item.Value}}</span>
            </li>
            {% endfor %}
        </ul>
    </div>
    

    In this way, even if the background deletes or adds custom fields, the front-end page can automatically adapt without modifying the template code.

In addition, AnQiCMS's custom field capabilities extend to the additional properties of the guestbook and category, allowing for highly customized interaction and display of these parts.

In summary, AnQiCMS's custom field feature brings unprecedented flexibility to content operation.It enhances content from simple text blocks to structured data collections, enabling websites to carry richer and more personalized information, presented in a way that aligns with user habits and business needs.This ability not only improves the efficiency of content management, but more importantly, it empowers content, enabling it to reach users more accurately and dynamically, thus

Related articles

How to implement personalized content display on the article detail page?

In website operation, the article detail page is not only a carrier of content, but also a key link for improving user experience, conveying brand value, and even achieving conversion goals.AnQiCMS (AnQiCMS) has provided us with rich features, making the personalized display of article detail pages accessible.It not only helps us meet the diverse needs of content presentation, but also allows each article to appear in front of readers with a refined posture.To create a unique article detail page, we can start with several core functions of Anqi CMS.--- ### One

2025-11-09

How to customize the display layout of different types of content in AnQiCMS?

## Unlock AnQiCMS: The Secret Weapon of Personalized Content Layout In the digital age, a website is not just a carrier of information, but also the core of brand image and user experience.A system that can flexibly customize the display layout of content, which is undoubtedly the key to improving operational efficiency and user attraction for small and medium-sized enterprises, self-media operators, and multi-site managers.AnQiCMS with its powerful content model and flexible template mechanism provides us with all the tools to achieve this goal. Today

2025-11-09

How to correctly parse and display Markdown formatted text in article content?

In Anqi CMS, using Markdown format to write articles is an efficient and elegant way of content creation, which makes our content structure clearer and layout more flexible.Especially for technical articles that need to include code, mathematical formulas, and even flowcharts, Markdown editors are an indispensable tool.How can we ensure that these carefully written Markdown texts are correctly parsed and perfectly presented on the website front-end?Let's explore step by step. ### Enable Markdown Editor First

2025-11-09

How to configure pseudo-static URL rules to optimize the search engine display of website content?

In today's internet environment, the search engine display effect of website content is directly related to traffic and conversion.A clear and meaningful URL structure not only enhances user experience but is also an indispensable part of search engine optimization (SEO).AnQiCMS (AnQiCMS) understands this and therefore provides a powerful and flexible pseudo-static URL rule configuration function to help website managers easily optimize URL structure.Why configuring pseudo-static URL rules is crucial for the search engine display of website content?Before getting to know how to configure

2025-11-09

How can I apply a unique document display template under a specific category?

When managing the content of our website, we often encounter such situations: We want articles under a specific category to be presented in a unique layout or style, distinct from the standard display of other parts of the website.For example, product showcase articles may need to include detailed parameter tables and multi-image carousels, while blog articles focus on smooth reading experience and comment sections.AnQi CMS fully understands the importance of this personalized need and provides a very flexible and intuitive way to achieve this, that is to apply a unique document display template for specific categories.

2025-11-09

What methods does AnQiCMS support to display images and thumbnails?

When building and operating a website, displaying images and thumbnails is an indispensable element in attracting users and conveying information.An excellent content management system (CMS) should provide powerful and flexible image processing capabilities.AnQiCMS performs well in this aspect, it not only simplifies the image management process, but also provides a variety of intelligent display methods, helping us easily create websites with outstanding visual effects and fast loading speed.### Core Image Management Capability: Say goodbye to chaos Firstly, AnQiCMS provides a centralized "Image Resource Management" function

2025-11-09

How to set the recommended attributes of the article to affect the front-end content sorting and display?

In content operation, how to make meticulously crafted articles seen by more readers and presented in the most prominent position on the website is the core concern of every operator.AnQiCMS provides a set of intuitive and powerful article recommendation attribute settings, helping us easily achieve fine-grained content management and front-end display optimization.This article will elaborate on how to use these properties to cleverly affect the sorting and display of the content on your website's front end.What are article recommendation attributes?

2025-11-09

Can I design a dedicated display style for a single page (such as 'About Us')?

In website operation, we all hope that each page can perfectly present its unique content and brand image.For single pages such as 'About Us' and 'Contact Information' that carry corporate culture, core values, or important service information, having a dedicated display style undoubtedly enhances the page's attractiveness and user experience.So, can we design exclusive display styles for these single-page designs in AnQiCMS (AnQiCMS)?The answer is affirmative, and it is more flexible and convenient than you imagined.The Aanqi CMS understands the personalized needs of content display

2025-11-09