How to display different types of data (such as) through the AnQi CMS custom content model?

Calendar 👁️ 66

When building a website, we often encounter situations where the content is not just simple 'articles' or 'products'.Traditional website content management systems are often limited to a few preset content types, which can be inadequate when facing diverse information display needs.AnQiCMS is well-versed in this, providing you with a powerful tool for easily handling various data displays through its flexible custom content model function.

Say goodbye to single content and embrace personalized data structures.

Imagine that if you run a real estate website, in addition to publishing real estate news articles, you also need to display detailed property information, including the layout, area, floor, orientation, price, and so on;Or you are running an online education platform, you need to display course names, instructors, class hours, suitable audiences, prices, and so on.This information cannot be simply classified as 'article' or 'product', each of them has a unique set of properties.

The customized content model of AnQi CMS is specifically designed to address this pain point. It allows you to create new content types that fully comply with your business needs,Create new content types that perfectly match your data structure.The system is built-in with 'Article Model' and 'Product Model' as common benchmarks. Based on this, you can expand infinitely, building models such as 'Real Estate Model', 'Course Model', 'Service Project Model', 'Activity Enrollment Model', and so on, truly realizing personalized and refined content management on your website.

Custom data field: Arrange information in place

The core of creating a custom content model lies in defining its exclusive data fields.In the Anqi CMS backend, you can add a series of fields for each custom model, which will precisely define all the information contained in the model.

  • Single line text type:Suitable for brief information such as "House name", "Community name", "Contact number", etc.
  • Numeric type:Applicable to numerical data such as "area (square meters)", "floor", and "price (10,000 yuan)", the system will automatically perform validity checks.
  • Multi-line text type:Applicable to long text content such as 'House Description', 'Surrounding Facilities', etc.
  • Single selection type: For example, "house type" (one bedroom living room, two bedrooms living room, three bedrooms living room), you can preset multiple options, and you can only choose one when publishing content.
  • Multiple choice type:For example, "House Features" (north-south through, high-end decoration, school district, near subway), multiple related properties can be selected when publishing content.
  • Select type below:Applicable to 'Orientation' (north, south, east, west, southeast, southwest), and preset options are provided to unify data input.
  • Image/Attachment type:Used for uploading house pictures, floor plans, or related documents.

In addition to the above basic types, you can also set 'whether mandatory' for each field to ensure the completeness of key information; or set 'default value' to improve the efficiency of content publication.In this way, each content type has a unique, clear data skeleton, greatly improving the efficiency and accuracy of content management.

Template rendering: beautifully presenting structured data.

Having structured data, the next step is how to beautifully display it on the website front end.The Anqi CMS uses a template engine syntax similar to Django, allowing you to easily display data from custom content models on the page.

After you have published a set of housing information in the "Housing Model", you can call the fields you have defined one by one in the corresponding template file. For example, to display the name of the housing, you can use{{archive.Title}}; To display a custom 'area' field, you can use{{archive.面积}}(Assuming you will name the field "area". If your custom field content may contain HTML tags, don't forget to add them)|safeA filter to ensure that HTML content is parsed correctly and not displayed as escaped.

For those custom fields displayed in a list format, such as the 'features' tags of a listing, or product parameters, you can use{% archiveParams params %}Labels to iterate over all custom parameters, then render dynamically according to the field name (item.Name) and value (item.Value) to dynamically render. This method is particularly suitable for scenarios where content parameters are variable and difficult to list in advance.

In addition, the AnQi CMS template system also supports powerful list and filtering functions. You can combine{% archiveList %}tags to filter by model, category, or even custom field conditions (througharchiveFilters) to filter and display different types of list data.For example, you can implement filtering by "type" and "price range" on the listing page to provide users with more accurate property information.

Application scenarios: endless possibilities

The application scenarios of custom content models are not limited to articles and products:

  • Enterprise service display:Define the 'service project model', including 'service content', 'industry applicable', 'successful cases', 'price range', and other fields.
  • Activity registration system:Define the 'event model', including 'event theme', 'start time', 'end time', 'event location', 'registration deadline', 'cost', 'organizer', and so on.
  • Job information posting:Define a "position model", including "position name", "number of recruitment", "work location", "duties and responsibilities", "qualification requirements", "salary range", and so on.
  • Software/Solution Showcase:Define the "Solution Model", including "Solution Name", "Problem Solved", "Core Features", "Application Scenarios", "Customer Cases", and so on.

By customizing the content model, AnQi CMS makes your website not just an information publishing platform, but also a powerful content center that can flexibly adapt to various business scenarios and efficiently manage structured data.This has greatly improved the efficiency of content operations and also brought a qualitative leap in website SEO optimization and user experience.


Frequently Asked Questions (FAQ)

1. What is the difference between a custom content model and a normal category?The ordinary classification (such as "domestic news" under "news center", "international news") is mainly used for classifying content under the same content model (such as "article model"). The custom content model definesThe data structure itself of different types.For example, "article" and "housing" are two different content models, each with its own set of independent fields (articles have authors and sources, while housing has types and area), and the classifications under each model are used to further refine the content ownership.

2. After creating and adding data, can you modify or delete a custom content model?You can certainly modify the custom content model you have created, such as adding new fields, modifying field types (without affecting data compatibility).However, be sure to handle the delete operation with care.All categories and content data under this model will be permanently deleted and cannot be recoveredTherefore, please make sure you no longer need these data before deletion and make backups.

How to display the fields I added to the custom content model on the front-end page?In the front-end template, you can call custom fields through the Anqi CMS template tags. For the detail page of a single article, you can directly use{{archive.您的自定义字段名}}To display the value of a specific field. If the content contains multiple custom parameters, you can also use{% archiveParams params %}tags to iterate over all custom fields, then use{% for item in params %}{{item.Name}}: {{item.Value}}{% endfor %}The way to dynamically display them. Remember that if the field content contains HTML, it needs to be used|safea filter to ensure correct rendering.

Related articles

How to ensure that watermarks and anti-crawling interference codes are automatically added when images are displayed in the Anq CMS?

In today's era of digital content prosperity, the copyright protection and prevention of content being maliciously collected has become an important issue that every website operator cannot ignore.Handcrafted images and content, without protection, are easily copied by dishonest elements with a single click, not only damaging the creators' labor but also affecting the authority and brand value of the website.

2025-11-08

What website modes (adaptive, PC+Mobile) does AnQi CMS support to display content?

In the era of multi-screen interconnection, how website content adapts to different devices directly affects user experience and the efficiency of information dissemination.AnQi CMS fully considers this requirement, providing users with a variety of flexible website content display modes, ensuring that your website can be presented in **status** on various devices such as PCs, tablets, and mobile phones, bringing visitors a smooth and comfortable browsing experience.The AnQi CMS mainly supports three core modes in content display: adaptive mode, code adaptation mode, and PC+Mobile independent site mode.These three patterns have their own focus

2025-11-08

How to take advantage of the pseudo-static function of Anqi CMS to optimize URL display for SEO?

In website operations, a clear and friendly website address (URL) not only improves user experience, but is also an indispensable part of search engine optimization (SEO).The original dynamic URL often contains complex parameters and symbols, which is not very friendly to search engine spiders and user understanding.The pseudo-static feature is exactly to convert these complex dynamic URLs into concise, readable, and static page-like URLs, thus optimizing the website's performance at both the visual and technical levels.

2025-11-08

How to achieve multi-language content switching and display in AnQi CMS?

Under the wave of globalization content marketing, website support for multiple languages has become an indispensable function.AnQiCMS (AnQiCMS) understands this need and provides a flexible multilingual solution to help us easily present content to users in different languages.This article will discuss in detail how to implement multi-language content switching and display in Anqi CMS.### Distinguishing System Language and Content Language Before delving deeper, we first need to clarify the concepts of two types of "languages" in Anqi CMS: 1. **System Backend Language Pack:**

2025-11-08

How to customize the display layout and style of AnQi CMS

Customizing the display layout and style of website content in AnQi CMS is an indispensable part of building a website that is both beautiful and efficient.The system provides a rich set of tools and flexible mechanisms, allowing users to fully control the visual presentation of the website from content structure, template selection to detailed style. ### Core Foundation: Flexible Content Model and Custom Backend The display of website content first depends on its inherent structure. One of the advantages of AnQi CMS is that it provides the 'flexible content model' feature.

2025-11-08

How to set up independent template files for specific pages or content types?

In website operation, we often encounter situations where we need to design a unique display style for certain pages or content types.Perhaps the product detail page needs a more attractive layout, or some special topic article needs to break the conventional style to highlight its importance, or a single-page 'About Us' needs to showcase the brand characteristics.AnQi CMS deeply understands this personalized need, providing flexible and powerful template customization capabilities, allowing you to easily set up exclusive template files for different content, thereby achieving more refined content presentation and brand image management.--- ###

2025-11-08

What template file types and directory structures does AnQi CMS support to organize displayed content?

AnQi CMS provides high flexibility and strong organizational capabilities in content display, which is mainly reflected in its support for template file types and directory structures.Understanding these conventions and mechanisms can help you customize the appearance and content layout of the website more efficiently. ### The core structure and conventions of template files Firstly, AnQi CMS will统一存放 all template files used for front-end display in the root directory of the site under the `/template` folder.Each independent website theme or template set should have its own folder in this directory

2025-11-08

How can you reference common header, footer, or sidebar content in a template?

In the daily operation and maintenance of the website, we often encounter such situations: each page needs to include a unified header, a standard footer, or a fixed sidebar.If every page were to rewrite this content, it would not only be inefficient but also a huge amount of work to modify once.AnQiCMS (AnQiCMS) understands this pain point and therefore provides a flexible and powerful template reference mechanism to help us efficiently manage these common contents, ensuring the unity and maintainability of the website.### Overview of AnQi CMS Template Mechanism In AnQi CMS

2025-11-08