How to display custom product parameters and specifications on the product detail page?

Calendar 👁️ 80

Add custom parameters and specifications to the product detail page in AnQiCMS, which can make your product information more detailed and professional.Whether it is the technical parameters of electronic products, or the size, color options of clothing, you can easily achieve these personalized display needs through a flexible content model.Next, we will step by step understand how to set, fill in, and finally display these customized parameters and specifications on your product detail page.


Step 1: Define product custom parameters in the background

To begin adding custom parameters to products, we first need to define the structure of these parameters in the AnQiCMS backend. This is mainly done through the content model feature.

You can enter the "Content Management" section of the backend and then select the "Content Model".Here, you will see the system-built "product model".Click to edit and enter the product model settings interface, or if you have special requirements, you can also choose to create a completely new custom model.

On the model settings page, a very critical part is the "custom field of content model".This is where you define the parameters of the product. Click Add Field to set the following content for each parameter:

  • Parameter NameThis is the parameter name displayed on the front page to the user, for example 'Processor Model', 'Memory Capacity', or 'Color Options'.
  • Field invocationThis is a technical name used to call this parameter in a template. It is recommended to use concise letters, such asprocessorModelorcolorOptions.
  • Field type: AnQiCMS provides various field types to meet different data entry and display needs. You can choose:
    • Single-line text: Suitable for short text information, such as model names.
    • NumberApplicable to price, inventory, or size information.
    • Multi-line textApplicable to product features, brief introductions, or longer texts.
    • Single choiceProvide preset options, the user can only select one item, such as 'yes/no' or a single color.
    • Multiple selectionsProvide preset options, the user can select multiple items, such as various accessories.
    • Drop-down selectionProvide a dropdown menu for users to select, such as specific categories of product series.
  • Mandatory?You can set whether this parameter is required or not as needed.
  • Default valueSet an initial value for the field. Each line entered here will become an independent option for single-choice, multiple-choice, and dropdown types.

After setting up all the custom fields, remember to save your content model so that the new parameter definitions take effect.

Step two: Fill in the custom parameter values for the product.

After defining the structure of product parameters, the next step is to fill in these parameter values for the specific product.

You can go to the "Content Management" under the "Publish Documents" page to create a new product, or edit an existing one.When publishing or editing a product, please make sure to select a category under 'Belonging Category' that uses the 'Product Model' you just configured.

After selecting a category, you will notice a collapsible box named "Other parameters" at the bottom of the page.Expand this collapse box and you will see the "More Model Custom Fields" section, which lists all the custom parameters you defined in the first step.According to the type of each field, you can enter text, numbers, or select from predefined options.For example, for the 'Color Options' field, you can select white from the drop-down menu or check multiple colors in the checkboxes.

After carefully filling in all the custom parameters of the product, click the save or publish button on the page, your product will successfully enter the database with this rich information.

Step 3: Display custom parameters and specifications on the product detail page

The last step is also the most critical one, which is to display the customized parameters you have set and filled in on the product detail page.AnQiCMS's template system provides powerful tag functions, making this process very intuitive.

Generally, the template files for the product detail page are located in the template package you are currently usingproduct/detail.html(If your model table name isproduct)。You need to edit this file to add code to display custom parameters.

AnQiCMS mainly provides two ways to display these custom fields:

Method 1: Loop to display all custom parameters

If you wish to list all custom parameters uniformly, for example, in a "Specification Parameters" or "Product Features" area, then usearchiveParamsThe tag is the most convenient choice. This tag will automatically retrieve all custom parameters of the current product and allow you to traverse them.

The following is an example of how to use it.archiveParamsTags:

<div class="product-specs">
    <h2>产品规格参数</h2>
    {% archiveParams params %}
    {% if params %} {# 判断是否存在自定义参数 #}
    <table>
        <tbody>
        {% for item in params %}
        <tr>
            <th>{{item.Name}}:</th> {# 参数名,例如“处理器型号” #}
            <td>{{item.Value|safe}}</td> {# 参数值,例如“Intel i7-12700K”,注意|safe过滤器以防HTML内容 #}
        </tr>
        {% endfor %}
        </tbody>
    </table>
    {% else %}
    <p>暂无详细参数信息。</p>
    {% endif %}
    {% endarchiveParams %}
</div>

In this example,archiveParams paramsAssign the custom parameters of the current product as an array.paramsthe variable. Then, we usefor item in paramsLoop through each parameter.item.NameIt will output the parameter name (such as "Processor model"),item.ValueIt will output the value you fill in the background.|safeThe filter is very important here, it ensures that if your custom field contains HTML content (such as multiline text

Related articles

How to correctly display the list of related articles on the content detail page in AnQiCMS?

On AnQiCMS content detail page, displaying related article lists can effectively guide visitors to browse more content, reduce the bounce rate, and enhance the website's SEO performance through internal link structure.AnQiCMS is a system designed specifically for content operations, providing flexible and powerful template tags, allowing us to easily achieve this function.How does AnQiCMS recognize and display related articles?To make the content detail page intelligently display a list related to the current article, AnQiCMS provides a straightforward mechanism

2025-11-07

How to implement the dynamic display of multi-level navigation menus in front-end templates?

In web design, a clear and easy-to-use navigation menu is the key to improving user experience and the professionalism of the website.AnQiCMS (AnQiCMS) provides the convenience of dynamically building multi-level navigation menus in front-end templates with its flexible template engine and powerful content management features.Understand the backend configuration and the calling logic of the front-end template of its navigation system, which is the foundation for achieving this goal. ### Overview of Anqi CMS Navigation System The navigation feature of Anqi CMS is designed to be very practical, closely integrating the creation of navigation menus with content display. On the backend

2025-11-07

How to implement lazy loading (Lazyload) of images in the article content to optimize page performance?

In website operation, page loading speed is crucial for user experience and search engine optimization (SEO).Especially when the article content includes a large number of images, the loading of image files often becomes the "culprit" that slows down the page speed.Lucky enough, by implementing the Lazyload image technology, we can effectively solve this problem.For friends using AnQiCMS, understanding and applying this technology will significantly improve website performance. Image lazy loading, as the name implies, is to delay the loading of images outside the user's current viewport.When the user scrolls the page

2025-11-07

How does AnQiCMS ensure the safety and compliance of front-end displayed content, such as sensitive word filtering?

When operating a website, the security and compliance of content is an indispensable part, especially in the context of the increasingly regulated online environment today.For users who use AnQiCMS, the system provides a variety of functions to help ensure the security and compliance of the displayed content on the front end, such as the sensitive word filtering that users are generally concerned about.At the beginning of its design, AnQiCMS placed content security at the core position.It is not just a content publishing tool, but also a platform dedicated to providing users with a safe and compliant content management environment

2025-11-07

How to set the display logic and hierarchy of breadcrumb navigation in AnQiCMS template?

When building a website, breadcrumb navigation not only effectively improves user experience and helps visitors understand their current location, but is also an indispensable part of search engine optimization (SEO), as it clearly shows the hierarchical structure of the website.For websites using AnQiCMS to manage content, flexibly setting the display logic and hierarchy of breadcrumb navigation is an important task in template creation.AnQiCMS provides a powerful and easy-to-use template tag for handling breadcrumb navigation, allowing you to easily implement it in the front-end template without writing complex backend logic

2025-11-07

How is the 'Multi-site Management' feature of AnQiCMS implemented to display different site content independently?

## Deeply analyze the "Multi-site Management" feature of AnQiCMS: How to ensure independent display of content?How to efficiently manage content when operating multiple websites or owning multiple brand sub-sites, while ensuring the independence of content on each site, is a challenge faced by many operators.The "multi-site management" feature provided by AnQiCMS is designed to solve this pain point.It not only allows you to manage all sites in a single background, but also fundamentally ensures that the content of each site is displayed independently, avoiding confusion and errors.So, AnQiCMS

2025-11-07

How to only display documents of the current category on the category list page and not include documents of subcategories?

When operating a website, we often encounter the need to display content, one common scenario being how to precisely control the displayed content on a category list page.Sometimes, we hope to display documents under a main category page, including all subcategory documents as well, to provide more comprehensive information.However, in some cases, in order to maintain the purity of the page theme and the focus of the content, we may only want to strictly display the documents under the current category without including any content from subcategories.AnQi CMS as a flexible content management system

2025-11-07

How does the AnQiCMS template format timestamps and display them in a specified date and time format?

In AnQiCMS template, easily format timestamps: Custom date and time display guide In website operation, content publishing time, update time, comment time, and other date information are an important part of the information we convey to visitors.Most of the time, the time data obtained from the database is usually a timestamp (a string of numbers), which is not intuitive for users.How to convert these original timestamps into a readable date and time format, and flexibly adjust the display according to the page design, which is a frequently encountered demand in template development. AnQiCMS

2025-11-07