How to use AnQi CMS to realize personalized display of different content models (such as articles, products)?

Calendar 👁️ 71

AnQi CMS is an efficient and customizable content management system, one of its core advantages is the flexible content model.This provides website operators with a great degree of freedom, allowing us to design unique structures and display methods for various content types such as 'articles', 'products', and more, thus realizing personalized presentation of website content.

Next, we will delve into how to take advantage of the powerful functions of Anqi CMS to achieve personalized display of content models.

Understanding the content model of Anqi CMS

In AnQi CMS, the content model is the skeleton that defines the structure of a certain type of content data.It determines which fields can be filled in and the types of these fields when we publish and manage content in the background.The system provides the commonly used "article model" and "product model" by default, each with a set of basic fields preset to meet the basic needs of article and product publishing.

However, the content of a website is often not limited to this. For example, a real estate website may need a "house model" that includes fields such as "house type", "area", "price", "location", and so on;A recruitment website may need a "job model", including "job title", "salary range", "work location", "publishing department", and so on.The Anqi CMS allows us to fully customize new content models and add exclusive custom fields for each model, which is the first step in achieving personalized display.

Core Strategy One: Use custom fields to enrich the content structure.

The personalized display of content primarily depends on whether the structure of the content is rich and accurate.The AnqiCMS custom field function allows us to add unique data items based on the specific characteristics of each content model.

For example, forArticle modelWe may also add fields such as title, content, publish time, etc.

  • Author: Single line text, recording the author of the article.
  • Source: One-line text, indicating the original source link or name of the article.
  • Reading time: Numeric type, estimated time required for readers to finish reading the article.
  • Recommended attributeMultiple selections, such as 'Top News', 'Recommendations', 'Sliders', etc., for easy display in different regions.

And forProduct modelTo better showcase the product features, we can add:

  • Product Model: Single-line text, precise product code.
  • Price: Numeric type, product selling price.
  • Inventory: Numeric type, current available stock of the product.
  • Main featuresMulti-line text highlighting the core advantages of the product.
  • Parameter listMulti-line text for entering detailed technical parameters of the product, which can be parsed into a table on the front-end.
  • Product album: Gallery type, upload multiple product images to create a carousel effect.

How to operate?In AnQi CMS backend, you can find the "Content Model" option under "Content Management".Here, you can modify existing models (such as articles, products) as well as “add new models”.In the model editing interface, you can add 'custom fields' to the model.Each field can be set to parameter name (front-end call name), field type (single-line text, number, multi-line text, single selection, multiple selection, dropdown selection, etc.), whether mandatory, and default value.For example, add a single-line text field named "Product Model" whose called field can beproductModel.

These custom field settings directly determine which information we can fill in when publishing content on the back end, and also lay the foundation for personalized display on the front end.

Core strategy two: Customize exclusive templates for different content models

With structured content, the next step is how to present them on the frontend page in a way that conforms to their type.The Anqi CMS template system provides high flexibility, allowing us to customize exclusive display templates for different content models, even specific categories or single pages.

The template files of AnQiCMS are usually named with.htmlsuffix and stored in/templateUnder the directory. Its template syntax is similar to the Django template engine, through{{变量}}to output data,{% 标签 %}Logical control is performed.

The system supports custom template names and can be applied automatically. For example:

  • The default template for the article detail page might bearticle/detail.html.
  • The default template for the product detail page might beproduct/detail.html.
  • The default template for the article list page might bearticle/list.html.
  • The default template for the product list page might beproduct/list.html.

In addition, more fine-grained personalized control lies in the fact that we canspecific categoriesorsingle content pieceSpecify the use of an independent template file:

  • In the "Document Category" settings, you can specify a "category template" for a category, for example, for the "Company News" category specifynews/list.htmlMake it consistent with the "Industry Information"industry/list.htmlDisplay style is different.
  • When adding a document or a product, you can specify a document template in the "Other parameters", for example, for a special productspecial_product/detail.htmlto have a detailed page layout that is completely different from that of ordinary products.
  • Even a single page can be customized, such as specifying a template for the "Contact Us" page.page/contact.html.

How to operate?Firstly, you need to/template/您的模板目录Create the corresponding template file, for examplearticle/detail.html/product/detail.html. If you want to specify a unique template for a category or document, for examplespecial_product/detail.htmlCreate the file as needed. Then, when editing the category or document in the background, enter the corresponding filename in the "Category Template" or "Document Template" field (such asspecial_product/detail.html), the system will load the corresponding template according to your settings.

Core strategy three: skillfully use template tags and filters to display personalized content.

With custom fields and dedicated templates, the final step is to extract the data through specific tags and filters in the template and present it in a beautiful and practical manner.

1. Extract content model data:archiveDetailandarchiveListThese tags are the core for fetching article, product and other content data.

  • {% archiveDetail with name="Title" %}It can fetch the title of the current content.
  • `{% archiveDetail with name=“Content” %

Related articles

How to display the friend link list on the AnQiCMS front-end page?

Friendship links are a way for websites to recommend each other, not only can they increase the number of external links to the website, but also be beneficial for search engine optimization (SEO), but also provide visitors with more entry points to related resources, enhancing the user experience.AnQiCMS provides a very convenient function for us to manage and display friend links. Next, we will learn together how to set up friend links in AnQiCMS and display them on the website's frontend page.### One, manage the friendship link in AnQiCMS background In AnQiCMS, managing friendship links is very intuitive

2025-11-08

How to display the user submitted comment form and its custom fields in AnQiCMS template?

In website operation, collecting user feedback and inquiries is an important link to improve service quality and understand user needs.AnQiCMS (AnQiCMS) provides a flexible and powerful message management function, allowing you to easily display a message form in the front-end template and support custom fields to meet the information collection needs of different business scenarios.To implement dynamic display of user submitted comment forms and custom fields in AnQiCMS templates, we mainly use a core tag: `guestbook`

2025-11-08

How to display a list of user-submitted comments on a website and handle the review status?

In website operation, user comments are an important element for building a community, obtaining feedback, and enhancing content interaction.For friends who use AnQiCMS (AnQiCMS) to build and manage websites, efficiently displaying user comments and managing their review status is a key factor in ensuring the quality of website content and user experience.The AnQiCMS provides very flexible and practical functions for this.

2025-11-08

How to correctly render Markdown content (including formulas, flowcharts) as HTML display in AnQiCMS?

AnQiCMS has always been committed to providing efficient and flexible solutions in content display, especially for the increasingly popular Markdown format in modern content creation, which includes complex content with mathematical formulas and flowcharts. AnQiCMS also provides a comprehensive support mechanism to ensure that these contents can be correctly parsed and beautifully presented on the web. To achieve the correct rendering of Markdown content (including formulas and flowcharts), it mainly involves two aspects: the first is the internal handling of Markdown text by the AnQiCMS system...

2025-11-08

How to configure and display multilingual website content in AnQi CMS?

AnQiCMS is dedicated to helping users easily meet the needs of global content promotion. It has built-in multilingual support functions, allowing you to flexibly configure and display different language versions of website content.No matter if you want to provide translations for static text in templates or create independent language versions for articles, products, and other core content, AnQi CMS offers intuitive and powerful tools.Next, we will explore how to configure and display multilingual website content in Anqi CMS.### The First Part

2025-11-08

How to optimize the setting of website URL static rules to enhance content display effect and SEO ranking?

In website operation, URL (Uniform Resource Locator) is not only the path for users to access the page, but also an important clue for search engines to understand the content and structure of the website.A well-optimized URL structure plays a crucial role in improving content display and SEO ranking.AnqiCMS (AnQi CMS) takes full consideration of SEO-friendliness in its design, providing flexible and powerful static rule management functions, allowing us to easily create beautiful and SEO-friendly URLs according to the needs of the website.Why do websites need static URLs

2025-11-08

How to customize the Anqi CMS template to meet the unique layout requirements of the website content?

In the digital age, a unique and functional website layout is the core element to attract users and convey brand information.AnQiCMS (AnQiCMS) is an enterprise-level content management system based on the Go language, which provides great flexibility to users with its efficient and customizable features, allowing you to easily create websites that meet specific content layout requirements.To fully utilize the powerful capabilities of AnQi CMS, custom templates are the key to personalized design.This not only involves visual beauty, but also concerns how to efficiently organize and display your website content.

2025-11-08

How to ensure efficient loading and display of images, videos, and other media resources on the page in Anqi CMS?

When operating a website, we all hope to provide visitors with a smooth and pleasant browsing experience.Among them, the loading speed of images, videos, and other media resources is undoubtedly a key factor affecting the experience.If the media resources on the page load slowly, visitors may become impatient and even leave directly.Lucky for it, AnQi CMS took full consideration of this from the beginning, providing various functions and strategies to help us efficiently manage and display these valuable resources.

2025-11-08