How to dynamically display custom parameter fields of articles or products in AnQiCMS?

Calendar 👁️ 70

When building and operating a website, we often need to display more information than just the title and content, such as product models, colors, inventory, or the author, source, and publishing platform of the article.AnQiCMS understands the importance of personalized content display and therefore provides a highly flexible custom parameter field function, making website content management and front-end presentation both powerful and convenient.Next, let's delve deeper into how to make full use of this feature in AnQiCMS, bringing dynamic content to your website.

Step 1: Define your content structure - Custom parameter field creation

In AnQiCMS, all content is organized based on the 'content model'.Whether it is an article, product, or other custom type, you can tailor a unique field structure for it.This is like building a dedicated 'skeleton' for your content, ensuring that each type of content can carry its unique information.

To create or modify custom parameter fields, you need to go to the 'Content Management' section of the AnQiCMS backend and find the 'Content Model'.Here, the default models such as 'article model' and 'product model' are provided, and you can also add custom models according to your business needs.

Select a content model to enter the editing interface, where you will see an area named 'Content Model Custom Fields'.In here, you can click "Add Field" to add new custom parameters to the model.During the addition process, several key pieces of information need to be clarified:

  • Parameter name:This is the name of this custom field displayed to the administrator in the backend management interface, for example, "Product Model", "Author Name", "Stock Quantity".It should be intuitive and easy to understand.
  • Call field:This is the field name that will be used when calling this parameter in the front-end template, it must be alphabetic, and it is recommended to use camel case (such asproductModel/authorName/stockQuantity). In the subsequent template development, we will mainly obtain data through this "call field".
  • Field type:AnQiCMS supports various field types to accommodate different data entry needs, for example:
    • Single-line text:Suitable for brief text information, such as model and brand.
    • Number:Ensure only numbers can be entered, suitable for prices, inventory, etc.
    • Multi-line text:Suitable for longer descriptions, such as product features, author bios.
    • Single choice, multiple choice, dropdown choice:These selection fields are very suitable for preset options, such as colors (red, blue, green), sizes (S, M, L), and regions, which greatly improve the standardization and accuracy of data entry.You can set these options one per line in the "Default".
  • Mandatory?:Based on the importance of the field, you can choose whether it should be a required field when publishing content.
  • Default:Set a default value for the field, which can be automatically filled in when publishing content to reduce manual input.

After completing these settings, save your content model. Now, you have successfully defined a new data structure for your content type.

Second step: Fill in your data - add custom information to the article or product

With a customized field structure, the next step is to enter the data for the actual article or product.When you go to the 'Content Management' under 'Publish Document' or edit an existing document, you will find a collapsible box for 'Other Parameters' at the bottom of the page.

Expand this collapse box, and you will see those custom fields that were just defined in the content model, clearly arranged according to the 'parameter name' you set.You can easily fill in unique property values for each piece of content, whether it is inputting text, selecting numbers, or making a selection in a dropdown menu, it is very intuitive.

If some fields are left blank, and you have set a default value for them in the content model, then when displayed on the front end, the system will automatically assign the default value to the field.For functions such as images contained in article content or automatically extracting summaries, AnQiCMS will also intelligently process them to save you time.

Third step: Dynamically display content - call custom parameters in the front-end template

The data entry is complete, the most exciting part is how to dynamically display this custom information on the website front-end.AnQiCMS uses Django template engine syntax, with its concise and powerful tag and variable calling methods, making this process efficient and flexible.

Display custom parameters in the template, mainly the following common methods:

1. Directly call specific custom fields in the detail page

If you are on the article or product detail page (usuallydetail.htmlor{模型table}/detail.htmlIn it, you can directly display a specific custom parameter, such as the "author" of an article or the "model" of a product.archiveAccess the properties of an object:

`twig {# Assume the custom field "author" is called author #}

Related articles

How to display related article recommendations on the AnQiCMS article detail page?

In website operation, the related article recommendation function on the article detail page can not only effectively improve the user's browsing depth within the site, reduce the bounce rate, but also guide users to discover more valuable content, indirectly improving the overall SEO performance of the website.AnQiCMS as a content management system that focuses on efficiency and scalability, provides flexible template tags, making it intuitive and convenient to implement this function. Let's discuss together how to elegantly implement related article recommendations on the article detail page of AnQiCMS.

2025-11-08

How to display the previous and next article links of the current article in AnQiCMS template?

In content operation, providing navigation to the previous and next articles for each article can not only significantly improve the user's reading experience, but also effectively increase the internal links of the website, which is of great benefit to search engine optimization (SEO).AnQi CMS with its flexible template system makes the implementation of this feature intuitive and efficient.By using a short template tag, you can easily integrate this practical navigation mechanism on the article detail page.

2025-11-08

How to display the detailed content of a specified article or product in AnQiCMS?

AnQiCMS (AnQiCMS) is an efficient and flexible content management system that provides an intuitive way to manage and display various types of content.When you want to display a specific article, product details, or any independent content page created through a content model on a website, the core lies in using its powerful template tag features.AnQiCMS refers to the articles, products, and other independently displayed content on the website as 'documents' (archive).

2025-11-08

How to retrieve a list of articles or products in AnQiCMS and support pagination display?

How to efficiently display articles or product lists in a content management system and provide users with a smooth pagination experience is a common concern for website operators.AnQiCMS is a system developed based on the Go language, which makes everything intuitive and efficient through its flexible and powerful template tag system.Next, we will discuss how to take advantage of the built-in features of AnQiCMS to easily implement the list display and pagination functions of articles or products.

2025-11-08

How to use the filtering feature of AnQiCMS to display a document list under specific conditions?

How to manage a large amount of content in AnQiCMS and allow users to quickly find the information they need is one of the key factors in content operation.Fortunately, AnQiCMS provides powerful filtering functions, allowing you to flexibly display document lists according to specific conditions, thereby greatly enhancing the website's user experience and content search efficiency. ### Clearly define your filtering requirements: Starting from the backend content model To make use of AnQiCMS's filtering feature, you first need to clarify the conditions through which you want users to search for content.

2025-11-08

How to list all Tag tags in the AnQiCMS template?

In Anqi CMS, using the template function to display all Tag tags on the website is an important operation that helps improve content discoverability and website SEO.AnQiCMS as an efficient content management system provides an intuitive and flexible tag (Tag) management mechanism, allowing users to easily list this content in website templates. ### Learn about AnQiCMS's Tag Function In AnQiCMS, tags (Tag) can be seen as topics or keywords that connect different content.They do not follow a strict hierarchical structure like categories

2025-11-08

How to display the description and link of a specific Tag label in AnQiCMS?

In Anqi CMS, a tag is a powerful content organization tool that not only helps you classify content more finely but also optimizes the website's SEO performance and improves the user's browsing experience.Sometimes, you may wish to display not only the name of the tag at a certain position on the website's frontend, but also its detailed description information, or even jump directly to the link related to the content of the tag.This is not a difficult task, Anqi CMS provides flexible template tags, allowing you to easily meet these needs.

2025-11-08

How to retrieve and display the list of documents under a specific Tag label in AnQiCMS?

In Anqi CMS, managing website content, the Tag tag is undoubtedly a very flexible and practical tool that helps us classify different categories and even different model content according to themes, greatly enriching the organization of content and the browsing experience of users.So when we want to display a list of all documents under a specific Tag on a dedicated page, Anqi CMS provides a very intuitive and powerful template tag to help us achieve this goal.### Understanding the role of Tag tags in Anqi CMS Before delving into the code

2025-11-08