How to customize the article display form in AnQi CMS based on the content model?

Calendar 👁️ 73

In Anqi CMS, utilizing the content model to flexibly define the display format of articles is one of its core strengths.It can make your website content not limited to traditional 'articles' or 'products' formats, but able to present various content structures according to actual business needs.

Understanding the core value of the content model

In the digital world, the content carried by websites is much richer than we imagine.In addition to common blog posts or product details, you may also need to display company activities, job openings, successful cases, course lists, and even real estate information or car configurations.These different content types have unique data structures and display requirements.For example, a 'job posting' should have a position name, salary range, location, and posting date fields;An event may include the event topic, start time, end time, location, number of registrants, and so on.

Traditional CMS systems often have strict restrictions on content structures, forcing you to adapt through makeshift or compromising solutions.But the flexible content model feature of Butanqi CMS is specifically designed to solve this pain point.It allows you to freely create and customize content models according to your business logic, building the most matching data structure for each type of content, thereby greatly enhancing the adaptability and management efficiency of the system.Built-in "article model" and "product model" are the foundation, while custom models open up infinite possibilities.

Custom content model: Build data structure from scratch

To start customizing the display form of content, you first need to start with the content model itself.

  1. Enter the content model management interface:Log in to the Anqi CMS backend, where you will find the 'Content Management' menu, which includes the 'Content Model' item.Click to enter, you will see the built-in "Article" and "Product" models, as well as the custom models you create in the future.
  2. Create or edit a model:You can choose to edit an existing model, or click 'Add New Model' to create a new content type. During the creation process, several key properties of the model need to be defined:
    • Model name:This is the Chinese name identified for this model in the background management interface, for example, "Recruitment Position", "Successful Case", or "Online Course".
    • Model table name:This is an English lowercase letter name used internally to store the data of this model in the database.For example, 'job', 'case', or 'course'.
    • URL alias:It is the English lowercase letter, which will be used to construct the URL address of the model content, for exampleyourdomain.com/job/xxx.
    • Title Name:This is the prompt text for the title field when publishing content under this model, for example, "Position Name" instead of the generic "Document Title".
  3. Core: Custom field settings:This is the most flexible place for the content model. You can add exclusive fields for each model to store unique information for that type of content. Click "Add field" to configure:
    • Parameter name:This is the Chinese display name of the field when managing in the background, for example, 'Salary Range', 'Event Location'.
    • Call field:This is the English name used when referencing this field in the template, it is recommended to use camel case, for examplesalaryRange/activityLocationThis name is the key to connecting backend data with front-end display.
    • Field type:The Anqi CMS provides various field types to adapt to different data formats:
      • Single-line text:Suitable for brief text information, such as "product model", "event theme".
      • Number:Ensure the input is numeric, such as 'inventory quantity', 'price'.
      • Multi-line text:Suitable for long descriptive content, such as 'event details', 'job description'.
      • Single choice/Multiple choice/Dropdown choice:These types allow you to preset a series of options that the user can select from (single-choice/dropdown) or select multiple (multiple-choice).They are very suitable for defining fixed options such as "product color", "size", "activity status", etc.
    • Mandatory?:Control whether this field must be filled in when publishing content.
    • Default:Provide default values for the field for convenient content publishing.

By following these steps, you have built a dedicated data skeleton for specific types of content.For example, in the "Product Model", in addition to the system's title, content, etc., you can add custom fields such as "Brand (Single-line Text)", "Price (Number)", "Inventory (Number)", "Product Features (Multi-line Text)", "Color (Multiple Choices)" and so on.

Display custom data on the front end: flexible application at the template level.

After the content model and custom field definitions are completed, the next step is how to elegantly present it on the website's frontend.The AnQi CMS template engine provides powerful tags and flexible mechanisms, allowing you to finely control the display of each part of the content.

  1. The correspondence between model and template:AnQi CMS follows a set of intuitive template naming conventions. For example, if you create a content model namedjobthen:

    • The list page template of the model is usually{模型table}/list.html, that isjob/list.html.
    • The detail page template of the model is usually{模型table}/detail.html, that isjob/detail.html. You can place these template files in the corresponding directory of your current theme.Moreover, AnQi CMS also supports specifying custom templates for specific individual articles or categories, which provides finer control. You can specify a custom HTML file path in the "Document Template" or "Category Template" field when editing articles or categories in the background.
  2. Core: How to call custom fields in the template:Once the data structure is defined in the background, you can use the template tags of Anqi CMS in the frontend template to call this data.

    • Display a custom field for a single content on the detail page:For words likejob/detail.htmlSuch a detail page, you will need to display specific information about the current job posting. At this point,archiveDetailandarchiveParamsLabels come in handy:
      • Call directly:Many custom fields can be accessed directly{{archive.调用字段名}}in the form. For example, if you have customized a field calledsalaryRange

Related articles

How does the AnQiCMS Sitemap tool improve the visibility of a website on search engine results pages?

In today's highly competitive online environment, ensuring that your website content is discovered and displayed at the top of search engine results pages (SERP) is fundamental for enhancing brand visibility and attracting potential users.AnQiCMS (AnQiCMS) is well aware of this as a content management system designed specifically for small and medium-sized enterprises and content operation teams.It comes with a powerful Sitemap tool designed to help users efficiently optimize their websites, thereby significantly improving their visibility in search engines.What is a Sitemap?

2025-11-08

How to ensure that the data collected through content acquisition and batch import can be displayed quickly on the front page?

In website operation, efficient content management is the key to improving user experience and SEO effectiveness.AnQiCMS (AnQiCMS) relies on its powerful content collection and batch import functions, greatly reducing the burden of content construction.However, we often encounter a core issue: How can we ensure that the content imported or collected through automated means is displayed on the front page to the user quickly and without delay?The Anqi CMS was designed with efficiency in content management and timely front-end display in mind, its underlying mechanisms and operational strategies can effectively help us solve this problem

2025-11-08

How to optimize the display form of website URLs in search engines with the help of pseudo-static and 301 redirection functions?

In website operations, a clear, readable, and SEO-friendly URL structure is a key element in improving website visibility and user experience.AnQiCMS (AnQiCMS) knows this point, therefore it builds in these two important functions of pseudo static and 301 redirection, aiming to help users easily optimize the display form of the website in search engines, thereby bringing better ranking and traffic performance.

2025-11-08

How does AnQiCMS support the switching of multilingual content and the correct display on the front-end page?

AnQiCMS provides powerful multilingual support capabilities, helping websites easily meet the needs of global content promotion.Understand its working principle and configuration method, which can help you efficiently manage content in different languages and display it correctly on the front-end page. ### The Foundation of Multilingual Content Management: Multi-Site Mode One of the core ideas of AnQiCMS for implementing multilingual content switching is to make use of its powerful multi-site management function.This means, typically, you would create a separate site instance for each target language.

2025-11-08

How to implement article list filtering by category, tag, or recommended attributes?

In website operation, how to efficiently organize and display a large amount of content, and ensure that users can quickly find the information they need, is the key to improving user experience and content value.AnQiCMS (AnQiCMS) provides powerful content management functions, among which the flexible filtering mechanism of the article list can help us easily achieve precise presentation of content.This article will discuss in detail how to filter and display article lists in Anqi CMS through categories, tags, and recommended attributes.--- ### Accurately Present: How to filter and display Anqi CMS article list by category, tag, or recommended attributes

2025-11-08

What sorting methods does AnQi CMS support to display articles and product lists?

How to flexibly display articles and product lists in a content management system is the key to improving user experience and optimizing information architecture.AnQiCMS (AnQiCMS) has provided us with a variety of practical sorting methods in this regard, allowing us to accurately present information based on different business needs and content strategies.### Core Sorting Mechanism: Flexible Control of Content Order AnQi CMS grants us fine-grained control over the display order of articles and product lists through its powerful template tag system

2025-11-08

How to configure a custom display template for the document detail page?

Manage website content in AnQi CMS, flexibility is one of its core advantages.When you need to present a unique content layout or style for a specific document detail page, the system provides powerful custom template functionality.This means that you can configure a dedicated display template for the document based on its type, content, and even specific document requirements, thus breaking away from the one-size-fits-all approach of traditional CMS and creating pages with greater appeal and functionality.The reason why AnQi CMS can achieve this is due to its 'flexible content model' design and the continuous enhancement of template customization capabilities in system iterations

2025-11-08

How to set up document thumbnails and control their display on list pages?

In a content management system, a striking thumbnail can greatly enhance the attractiveness of the content, whether it is in an article list, product display, or other content aggregation pages, it is an important visual element to guide users to click.AnQiCMS (AnQiCMS) is well aware of this and provides flexible thumbnail settings and display control features to help optimize the visual effects and user experience of your website.Next, we will discuss in detail how to set the thumbnail of the document in Anqi CMS and master its various display methods on the list page.### The First Part

2025-11-08