When building a successful website, especially for enterprises that need to showcase a diverse range of products, the personalization and accurate presentation of content are crucial.Traditional website content management systems often provide fixed or limited content types, which may not be sufficient when facing products with different properties and display requirements.AnQiCMS (AnQiCMS) understands this pain point, through its powerful custom content model features, it provides users with flexible and efficient solutions, making it possible to personalize product displays easily.

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

The content model is one of the core functions of Anqi CMS, which allows us to define a set of exclusive data structures to manage and display content according to business needs.Imagine if your website sold both electronic products and fashion clothing, and these two types of products have huge differences in properties: electronic products may need parameters such as "processor model", "memory size", "screen size", etc., while fashion clothing may need information such as "fabric", "size", "color", etc.".If only one fixed 'product' template is used, either the information is incomplete or it is filled with irrelevant fields, which is obviously不利于用户体验 and data management.

The flexible content model of AnQi CMS is specifically designed to solve such problems.It breaks the rigid content categories such as 'articles' and 'products', allowing us to create completely customized data structures for different types of products.This means that you can define unique attribute fields for each product type, thereby achieving true 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" option called "Content Model".Here is the freedom to create a new model or modify an existing one.Here are the key steps to implement personalized product display:

  1. Create or modify the content model:On the "Content Model" page, you can choose to add a new model, such as naming it "Electronic Product Model" or "Fashion Clothing Model". During the creation process, you need to fill in several core information:

    • Model name:This is a user-friendly name, convenient for you to identify and manage in the background, such as 'electronic products' or 'clothing'.
    • Model table name:This is the table name corresponding to the content model in the database, it usually uses lowercase letters, and the system will automatically handle it to ensure uniqueness.
    • URL alias:Used to generate the URL path for product detail pages, for example, if the URL alias for “Electronics” 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", "Product Title", etc., so that content entry personnel can understand at a glance.
  2. Add custom field:This is the most critical step in implementing personalized product display. On the content model editing page, you can freely add various custom fields.Each custom field can be designed according to the specific attributes of the product:

    • Parameter name:Field display name, such as 'Processor Model', 'Memory Size', 'Fabric', 'Size', 'Color', etc., which will be displayed directly in the background content editing interface.
    • Call field:This is an English field name used to call data in the front-end template, for examplecpu_model/memory_size/fabric/size/colorKeep the naming conventions, convenient for 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.
      • Number:Applicable to prices, inventory, dimensions (such as screen inches).
      • Multi-line text:Suitable for detailed product descriptions, technical parameters, instructions, and even supports rich text editing.
      • Single selection/dropdown selection:Applicable for predefined single options, such as operating system (Android/iOS), storage capacity (64GB/128GB).When setting, you can enter an option per line in the 'Default Value', and the system will automatically parse it.
      • Multiple selection:Multi-select features applicable to products, such as 'Waterproof', 'NFC Function', 'Fast Charge'.
    • Mandatory?:Set according to business needs to ensure that no important information is missed.
    • Default:Set default values for common options to improve content entry efficiency.

By 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(Numbers) fields; Add to the "Fashion Clothing Model".fabric(Single choice),color(Multiple choices),size(Dropdown selection) fields.

Display personalized product information in the front-end template.

After defining the content model, the next step is to call and display these personalized data in the front-end template.The Anqi CMS template engine supports syntax similar to Django templates, allowing data to be easily accessed through tags.

  1. Associate the content model when publishing a product:When you publish a new product in the background, you need to select the category to which the product belongs.Due to the classification of Anqi CMS being bound to the content model ("Document Classification Help"), selecting the correct classification will automatically apply the corresponding content model, thus displaying the custom fields you have created in the product editing interface, waiting for you to fill in.

  2. Call the custom field in the template:In the product detail page or any template that needs to display product information, you can use Anqi CMS'sarchiveDetailTag to get the current product details data, including all custom fields.

    • Directly call the specified field:If you know which custom field to display, you can directly access the field's调用字段Name to obtain. For example, if you define a model for electronic productscpu_modelfield, then you can use it directly in the template{% archiveDetail with name="cpu_model" %}to display its value.
    • 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 through. 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 (such as those entered through a rich text editor), they usually need to be displayed in the template using|safeThe filter to prevent HTML code from being escaped, ensuring correct rendering:{{archiveContent|safe}}.
  3. Filter using custom fields to filter:Of Security CMSarchiveFiltersTags allow you to build filtering functionality based on custom fields on the front end.For example, on the electronic product list page, users can filter based on custom fields such as 'memory size' and 'screen size' to quickly find products that meet their needs.This not only improved the user experience, but also provided more keyword layout opportunities for SEO.

The value of personalized product display

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

  • Achieve highly customized product display:Not limited by general fields, each product can be presented in the most appropriate and detailed way.
  • Optimizing user experience: Users can easily find and view the product properties they care 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 content.
  • Improve content management efficiency:The content entry personnel is faced with fields that match the product attributes perfectly, avoiding invalid entries and information omission.
  • Enhance website extensibility:When the business develops, it is only necessary to make simple configurations in the background when new product types or properties need to be added, without modifying the core code.

In short, the customized content model feature of Anqi CMS is a powerful tool for building personalized, high-efficiency product display websites.It provides website operators with great flexibility, allowing product displays to no longer be just a pile, but to become an important link in precise marketing and enhancing user value.


Frequently Asked Questions (FAQ)

Q1: I have created a content model and added custom fields, why do I not see these custom fields when selecting a category to publish a product? A1:Please check whether the category you have created is correctly bound to the content model you have created or modified.In AnQi CMS, documents (products) are determined by their category to decide which content model to use.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: Do I want the front-end user to be able to filter products based on custom fields (such as "color", "memory size")? Does Anqi CMS support this feature? How can it be implemented? A2:Yes, Anqi CMS supports this filtering feature based on custom fields. You can use template tagsarchiveFiltersBuild filtering conditions on the front-end page. First, make sure that when you create custom fields in the content model, you set them to types that can be used for filtering (such as single selection, multiple selection, etc.).Then use it in your product list page template,archiveFilterstags to render the filtering options, combinedarchiveListThe label performs data retrieval, after the user clicks the filter, the page will automatically filter and display the corresponding products according to 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 customized field types of AnQi CMS do not directly provide 'Image Carousel' or 'Multiple Image Upload' field types, you can achieve it in the following way:

  1. Image field (Images):Add a custom field in the content model, for example named "Product Album", the field name isproduct_galleryFields can be of multi-line text type, and when entering products in the background, upload multiple images to the corresponding "Product Album" field, obtain the image URL, and enter it separated by English commas. In the frontend template, you can get the value of this field and then throughsplitThe filter 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, each for storing the URLs of these images, and call them separately in the front-end template.This way, you can flexibly add multi-image display functions to your product.