When building a successful website, especially for businesses that need to showcase a diverse range of products, personalized and accurate content presentation is crucial.Traditional website content management systems often provide fixed or limited content types, which may not be sufficient when facing products with different attributes and display requirements.AnQiCMS (AnQiCMS) is fully aware of this pain point, providing users with a flexible and efficient solution through its powerful custom content model function, making the personalized display of products accessible.

AnQi CMS content model: The foundation for building flexible product display

Content model is one of the core functions of AnQi CMS, which allows us to define a set of exclusive data structures according to business needs to manage and display content.Imagine if your website sold both electronic products and fashion clothing, the product attributes of these two categories are vastly different: electronic products may require parameters such as 'processor model', 'memory size', 'screen size', while fashion clothing may require information such as 'fabric', 'size', 'color'.If only one fixed 'product' template is used, either the information is incomplete or it is filled with irrelevant fields, which is obviously不利于用户体验和数据管理.

The "Flexible Content Model" of AnQi CMS is exactly designed to solve such problems.It breaks the rigid content categories of "article" and "product", allowing us to create fully customized data structures for different types of products.This means that you can define unique attribute fields for each product type, thus achieving truly personalized product display.

How to customize the content model to meet product display requirements

In the AnQi CMS backend management interface, the entry for custom content models is located under the 'Content Management' section, specifically the 'Content Model' option.Here you have the freedom to create new models or modify existing models.

  1. Create or modify the content model:On the "Content Model

    • Model name:This is a user-friendly name, convenient for you to identify and manage in the background, such as "Electronics" or "Clothing".
    • Model Table Name:This is the corresponding table name in the database for the content model, usually using lowercase letters, and the system will automatically handle it to ensure uniqueness.
    • URL Alias:Used to generate the product detail page URL path, for example, if the URL alias of 'Electronic Products' is set to 'electronics', then the related product links may include this alias, which is beneficial for URL neatness and SEO optimization.
    • Title Name:Defined what the main title field should be called under this model, such as "Product Name
  2. Add custom fields:This is the most critical step to achieve personalized product display.In the content model editing page, you can freely add various custom fields.

    • Parameter name:The display name of the field, such as “Processor Model”, “Memory Size”, “Fabric”, “Size”, “Color”, etc., which will be displayed directly on the backend content editing interface.
    • Field call:This is an English field name, used to call data in the front-end template, for examplecpu_model/memory_size/fabric/size/color.Maintain naming conventions for ease of template development.
    • Field Type:Anqi CMS provides various field types to adapt to different data formats:
      • Single-line text:Applicable to short text information, such as product models, brand names.
      • Numbers:Applicable to price, inventory, size (such as screen inches).
      • Multi-line text:Applicable to detailed product descriptions, technical parameters, instructions for use, etc., and even supports rich text editing.
      • Single choice/dropdown selection:适用于预设的单一选项,如操作系统(Android/iOS)、存储容量(64GB/128GB)。When setting, you can enter an option per line in the "Default Value", and the system will automatically parse it.
      • Multiple selection:English for product's multiple choice features, such as 'Waterproof', 'NFC Function', 'Fast Charging'.
    • Mandatory:Set according to business needs to ensure that important information is not missed.
    • Default value:This is a preset value for commonly used options, which improves the efficiency of content entry.

Through these custom fields, you can build highly fitting data structures for different product types. For example, add for "Electronic Product Model"cpu_model(Single-line text),memory_size(Single choice),screen_size(Number) and other fields; add to the 'Fashion Model'fabric(Single choice),color(Multiple selection),size(Dropdown selection) and other fields.

Display personalized product information in the front-end template

Completed the definition of the content model, the next step is to call and display these personalized data in the frontend template.The template engine of Anqi CMS supports syntax similar to Django templates, and data can be easily accessed through tags.

  1. Publishing product-related content model when releasing a product:

  2. Call custom fields in the template:In the product details page or other templates that need to display product information, you can use the Anqi CMS:archiveDetailTag to get the details of the current product, including all custom fields.

    • Directly call the specified field:If you know which custom field to display, you can directly access the field through the调用字段Name to obtain. For example, if you define a model for electronic productscpu_modelfield, you can use it directly in the template{% archiveDetail with name="cpu_model" %}.
    • Loop through all custom fields:Sometimes you may want to loop through all custom fields and their values, especially when there are many fields. You can usearchiveParamstags to iterate over. For example:
      
      {% archiveParams params %}
      {% for item in params %}
      <div>
          <span>{{item.Name}}:</span>
          <span>{{item.Value}}</span>
      </div>
      {% endfor %}
      {% endarchiveParams %}
      
      This will list all custom fields in the form of "Parameter name: Parameter value."
    • Handle rich text content:If your custom field type is multi-line text and contains HTML tags (for example, entered through a rich text editor), it usually needs to be displayed in the template using|safeFilter to prevent HTML code from being escaped to ensure correct rendering:{{archiveContent|safe}}.
  3. Filter using custom fields:Anqi CMS'sarchiveFiltersTags allow you to build filter functions on the front end based on custom fields.For example, on the electronic products list page, users can filter by custom fields such as 'Memory Size', 'Screen Size', etc. to quickly find products that meet their needs.This not only improves the user experience, but also provides more keyword layout opportunities for SEO.

The value of personalized product display

Through the custom content model of Anqi CMS, your website will be able to:

  • Achieve highly customized product display:Users are no longer limited by general fields, and each type of product can be presented in the most appropriate and detailed manner.
  • Optimize user experience:Users can easily find and view the product attributes they are concerned about, improving conversion rates.
  • Improve SEO effectiveness:Rich custom fields provide more structured data and keywords for product detail pages, which helps search engines better understand and index the content.
  • Improve content management efficiency:The content entry personnel is faced with fields that are completely matched with product attributes, avoiding invalid entries and information omission.
  • Enhance website extensibility:With the development of business, when it is necessary to add new product types or properties, it only requires simple configuration on the backend, without the need to modify core code.

In summary, the custom content model feature of Anqi CMS is a powerful tool for building personalized, high-performance product display websites.It gives website operators great flexibility, making product display no longer just a simple pile, but an important link in precise marketing and enhancing user value.


Common Questions (FAQ)

Q1: I have created a content model and added custom fields, why do I not see these custom fields after selecting a category when publishing a product? A1:Please check if the category you created is correctly bound to the content model you created or modified.In the A safe CMS, documents (products) use which content model depends on their category.You need to go to the 'Content Management' under the 'Document Category' page, edit the corresponding category, and make sure the 'Document Model' option points to the content model you want to use.After saving the category, try publishing the product again, and you should be able to see the custom fields.

Q2: I want the front-end users to be able to filter products based on custom fields (such as 'color', 'memory size'). Does the Anqi CMS support this feature? How can it be implemented? A2:Yes, AnQi CMS supports this feature of filtering based on custom fields. You can use template tagsarchiveFiltersBuild the filter conditions on the front-end page.Ensure that you set the custom field to be filterable when creating it in the content model (such as single choice, multiple choice, etc.).archiveFiltersto render the filter options, combined witharchiveListLabel data acquisition, after the user clicks the filter, the page will automatically filter and display the corresponding products based on the URL parameters.

Q3: Can I include an image carousel or multiple image fields in a content model? A3:Of course you can. Although the custom field types of Anqi CMS do not directly provide 'image carousel' or 'multi-image upload' field types, you can achieve this in the following way:

  1. Grouped field (Images):Add a custom field to the content model, for example named “Product Gallery”, the field name is:product_gallery,Field type can be selected as multiline text, then upload multiple images in the corresponding 'Product Album' field during product entry in the background, and obtain the image URL, separated by English commas. You can get the value of this field in the frontend template and then throughsplitFilter splits it into an array and then loops through to display.
  2. Multiple image fields:If you need to differentiate between images for different purposes, such as 'main image', 'detail image 1', 'detail image 2', you can add multiple independent 'single line text' fields in the content model, which are used to store the URLs of these images respectively, and are called separately in the front-end template.This way, you can flexibly add multiple image display features to your product.