How to customize the content model of Anqi CMS to achieve diversified content display?

Calendar 👁️ 66

When building website content, we often find that different types of information have unique display requirements.A news article may require a title, author, publication date, and text;A product introduction may cover name, model, price, inventory, and detailed parameters;And a case study may focus more on the project name, client, solution, and results images.Traditional CMS systems often provide fixed and unchangeable content publishing templates, which are difficult to flexibly respond to in diverse business scenarios.

Aq CMS was born to solve this pain point, one of its core advantages is that it provideshighly flexible content model customization featuresThis feature allows you to break free from the constraints of preset frameworks, tailor the management and display methods to meet your actual business logic and content structure, and thus achieve truly diverse content display.

Why do you need to customize the content model?

Imagine that you are running a comprehensive website that includes various business segments, such as an enterprise official website that publishes industry news and sells all kinds of products.News and products have an essential difference in data structure.News may require fields such as "source", "summary", etc., while products must have "price", "specifications", "SKU", etc.If all the content is compressed into an "article" model, it will be confusing to manage in the background, and it will also be difficult to implement personalized layouts and functions on the front page.

The custom content model of AnQi CMS is the ideal solution for such scenarios.It allows you to create independent data structures for different content types, ensuring that the data for each type of content can be managed accurately and efficiently.This not only greatly improves the operation efficiency of the background, but also ensures that every part of the website's front-end content is presented to visitors in the most appropriate and attractive way, significantly enhancing the system's adaptability and user experience.

How to create and configure the content model in AnQi CMS?

In AnQi CMS, creating and configuring content models is intuitive and powerful.Firstly, you need to enter the background management interface, find the "Content Management" section in the left navigation bar, and click on "Content Model" to enter the management page.

The system defaults to built-in "Article Model" and "Product Model" as commonly used models, which can serve as a quick start reference and can be modified as needed.Of course, if you have more unique business needs, you can always click 'Add Custom Model' to create a new content model.

When creating or modifying a content model, you will find some key configuration options:

  • Model name: This is the Chinese name of the model recognized in the background, for example, 'Recruitment Information', 'Team Members' or 'Project Case'.
  • Model table nameThis is the content data stored in the database table name, it needs to be in lowercase English letters, and the system will read and write data according to this table name.
  • URL aliasThis English lowercase alias will be used in the front-end URL path, which helps to build friendly pseudo-static links, such as 'news', 'product', 'team'.
  • Title NameThis field replaces the default 'Title' prompt text, for example, in the product model, you can set it to 'Product Name' to make the published content more guiding.

The core to truly achieve diversified content display lies inCustom fields of the content modelHere, you can add an unlimited number of custom fields to your model to collect and store any necessary data.

For example, when creating a "house information" model, you can add:

  • "Area": single-line text
  • "Layout": dropdown selection (for example: one bedroom, two bedrooms, three bedrooms)
  • “Area”:numeric type
  • “Price”:numeric type
  • “Features”:multiple choices(for example:school district house,subway house,finely decorated)
  • “Property pictures”:Picture group type (through the image upload function provided by the system)”

Each custom field can be set to have a “parameter name” (such as “region”, “layout”), “field name” (such as “region”, “layout”), “field type” (single-line text, number, multi-line text, single selection, multiple selection, dropdown selection), and even set “required” and “default value” to ensure the standardization and convenience of data entry.These flexible field types can meet various complex data entry requirements, laying a foundation for the accurate display of front-end content.

How to use the custom content model for diversified content display?

Once the content model and its custom field configuration are completed, the next key is how to beautifully display it on the front end of the website.Our company's Anqi CMS adopts the Django template engine syntax, which is concise and powerful, allowing you to easily display data from the backend to visitors.

For a single content detail page, such as a news article or a product page, you can usearchiveDetailLabel to get the details of the current content, including all custom fields. For example, if you define a name for the product model aspricecustom field, which can be directly accessed through the template on the product detail page{{archive.price}}to display the price, or through{% archiveDetail with name="price" %}tags to call.

Further, if you wish to display all custom fields, especially for lists that may change frequently like product parameters,archiveParamsTags are very practical. They can loop through all custom fields and their values in the content model, allowing you to automatically adapt to new parameters in the background without modifying the template code, which is very suitable for building dynamic product specifications or information lists.

For content list pages, such as news lists or product lists,archiveListThe tag is responsible for retrieving the content set. While iterating through each content item, you can also access all its standard fields and custom fields.This means that you can design completely different layouts for different list pages based on the type of content model.A recruitment information list can highlight the job title, location, and posting time;A team member list can display name, position, avatar, and introduction.

The AnQi CMS also provides powerful template customization capabilities.You can specify an independent template file for a specific category or even a single content page.For example, your "news center" category can adoptarticle/list.htmltemplates, while the "Product Display" category can be enabledproduct/list.htmlTemplate. Even, for a special "About Us" page, you can customize a unique one.page/about.htmlTemplate. This extremely granular template control ensures that each content type on the website has a dedicated visual presentation that matches its properties and functions, truly achieving a perfect blend of content and design, bringing visitors a rich and targeted browsing experience.

The customized content model feature of AnQi CMS is not just about data storage, but also the art of content presentation.It endows the website with great flexibility and expressiveness, allowing your website to evolve continuously according to business development, showcasing diverse and attractive content in the most tailored way to meet user needs.

Frequently Asked Questions (FAQ)

  1. What is the difference between the fields in the custom content model and the title, content, etc. that come with the article/product?Each content in AnQi CMS (whether it is an article, product, or a custom model) will have some fixed and common fields, such as "title", "content", "description", and "thumbnail", etc., which are the basic properties shared by all content types.And the 'custom field' is an additional attribute tailored to a specific content model, which only exists in the content under that model.For example, the "Product Model" under "Price" or "Stock" is a unique custom field, which is usually not needed under the "Article Model".This makes the content structure clearer and management more efficient.

  2. Will the published content be affected if I modify the fields of the content model (for example, adding or deleting a custom field)?In most cases, adding a custom field does not affect the display of published content, but this content will be displayed as empty in the new field. When deleting a custom field, the system will prompt you that this operation will delete all

Related articles

How to generate `breadcrumb` tags?

On a day when the content of a website is becoming richer, users often need to navigate between different pages on the website.To help visitors understand their current location and provide a convenient return path, breadcrumb navigation (Breadcrumb Navigation) has emerged.It is like a path indicator on a map, making it clear for the user to know 'Where I came from and where I am going to.'

2025-11-08

How to use the `navList` tag to create the main navigation menu of a website and support two-level dropdown display?

The main navigation menu of the website is an important entry for users to understand the content and structure of the website.The Anqi CMS provides a powerful and flexible `navList` tag, which helps us easily create and manage multi-level dropdown navigation menus, thus enhancing the user experience and clarity of the information architecture of the website. ### Step 1: Configure the navigation menu in the AnQi CMS backend Before starting to write template code, we need to set up the structure of the navigation menu in the AnQi CMS backend management system. 1.

2025-11-08

How to display all related document lists under a specific `tagDataList` tag and support pagination?

In AnQi CMS' daily content management, we often need to organize and display website content more flexibly.In addition to the traditional classification system, tags (Tag) provide us with another powerful way to associate content.It can aggregate documents from different categories but with similar themes, providing users with a more focused browsing experience.Today, let's delve into a very practical template tag in Anqi CMS, `tagDataList`, and see how it helps us display all related document lists under a specific tag and easily implement pagination.

2025-11-08

How to effectively manage and display single-page content on a website using `pageList` and `pageDetail` tags?

In website operation, single-page content plays an indispensable role, it usually carries important information such as "About Us", "Contact Us", "Terms of Service", "Privacy Policy", etc., which needs to be clearly displayed and also requires convenient management.AnQiCMS provides the powerful template tags `pageList` and `pageDetail`, which help us efficiently manage and display these single-page content.

2025-11-08

How to set a unique display layout for different types of articles (such as news, products)?

In website operation, content is not just information itself, but also the way it is presented is equally important.Setting unique display layouts for different types of content (such as news, product introductions) can greatly enhance user experience, strengthen brand image, and even have a positive impact on search engine optimization (SEO).AnQiCMS (AnQiCMS) provides very flexible and powerful features in this aspect, allowing you to easily create exclusive visual styles for various types of content.

2025-11-08

How does the multilingual support of Anqi CMS affect the display and switching of front-end content?

AnQiCMS provides powerful multilingual support capabilities, which is crucial for websites that want to expand into global markets and provide localized content experiences for users of different languages.It not only affects the way the front-end content of the website is presented, but also provides users with a smooth language switching experience.Understanding how it works can help us better plan and operate multilingual websites.

2025-11-08

How does static URL affect the display results of a website in search engines?

Have you ever been troubled by a long string of question marks, equals signs, and numbers in the website address bar?Such a URL is not only visually unattractive, but may also subtly affect your website's performance in search engines.The so-called 'pseudo-static URL' we often talk about is used to solve this problem.Then, what impact do these static URLs have on the display results of a website in search engines?Let's delve into it together.What is a static URL and why is it important?

2025-11-08

How to use the advanced SEO tools of AnQI CMS to optimize the title and description of a page in search results?

On search engine results pages (SERP), your website page title (Title) and description (Description) are like your online business card, representing the first opportunity for users to encounter your content.A well-optimized title can attract clicks, and a clear, engaging description can effectively convey the value of the page, thereby increasing the willingness of users to visit.AnQiCMS fully understands the core value of search engine optimization and has provided powerful and easy-to-use advanced SEO tools to help you refine every page's "business card".

2025-11-08