How to add a custom content model field in the AnQi CMS editing interface?

Calendar 👁️ 76

AnQiCMS (AnQiCMS) is an efficient and highly customizable content management system, one of its core highlights is the flexible content model.This endows website operators with powerful capabilities, enabling them to deeply customize the structure and display of content according to actual business needs.In daily content operations, we often encounter situations where we need to add exclusive information for different types of content. At this time, the custom content model field function of Anqi CMS becomes particularly important, as it makes our content management more refined and personalized.

Unique advantages of the Anqi CMS content model

The strength of AnQi CMS lies in the fact that it is not a one-size-fits-all system, but allows users to flexibly define content models according to their unique business needs.This means that whether it is publishing regular industry articles, complex product detail pages, or corporate case studies, event announcements, etc., we can tailor data structures for each type of content.This flexibility significantly enhances the adaptability of the system, allowing us to organize and present information in the most business logic-friendly way.

However, the built-in fields of the system are inevitably limited. As our business develops to a certain stage, we may need to record some more specific, non-standardized information, such as the "market time" of products, "target audience", or "expert comments", "source of citation" of articles, etc.At this time, by adding a custom content model field, we can easily expand the existing content structure without touching the underlying code, and can integrate this unique information into the management system.

What is a custom content model field?

In simple terms, custom content model fields are additional data items added for your specific content type (such as "product" or "service").Imagine you are using Anqi CMS to publish a product introduction about the latest model of a smartphone.In addition to the basic information such as the title, product images, and detailed description, you may also want to add key parameters such as "memory capacity", "battery life", and "screen size", and even allow users to choose the "color" or "storage version".These "memory capacity", "battery life", etc., are custom fields.They make the information you post more complete, structured, and easier for users to filter and understand.

How to add a custom content model field in the AnQi CMS editing interface?

Now, let's add a custom content model field step by step in the Anqi CMS backend interface. The entire process is intuitive and easy to operate.

First, you need to log in to the Anqi CMS backend management interface. After successful login, find the "" option in the left navigation menu and click to expand. You will see a name calledContent Management"Content modelThe submenu, click it, and you will enter the core area of content model management.

Here, you will see the system's default built-in "article model" and "product model", as well as any other custom models you may have created. You can choose to modify an existing model (such as the "product model") by adding new fields; or, if your requirement is for a completely new content type, you can also click on the link at the top of the page.Add ModelButton, start from scratch to create a content model exclusively yours.

Whether it is to modify an existing model or create a new one, the next step is to enter the editing details page of the model. In this page, you will find an important area calledCustom fields for content modelThis is where we add new fields.

Click “Add fieldsButton, a new form will appear in front of you, where you need to define your new fields:

  • Parameter NameThis is the custom field name you defined, which is also displayed to the content editor on the backend editing page. For example, if you want to add a field to record the mobile phone memory capacity, the parameter name can be filled in asMemory CapacityA clear parameter name helps the content team understand and use it.
  • Field invocationThis field is the English identifier you use when calling the data in the front-end template.It must be English letters and remain unique within a model.For example, corresponding to "memory capacity", you can set the field to be calledmemoryCapacity. This name will be frequently used in subsequent template development, so it must be concise and descriptive.
  • Field type: AnQi CMS provides various predefined field types to meet the storage needs of different data. Choosing the appropriate type is crucial:
    • Single-line text: Suitable for short text input, such as product models, author names.
    • NumberIf you need to enter pure numbers, such as prices, inventory quantities, etc., selecting this type can ensure data accuracy.
    • Multi-line textUsed for longer descriptive text, such as product features, detailed specifications, etc.
    • Single choice: Use when you want the user to select one from a set of predefined options, such as the 'color' (red, blue, green) of a product.
    • Multiple selectionsAllow users to select one or more preset options, such as the product's 'size' (S, M, L, XL).
    • Drop-down selection: The function is similar to single selection, but presented in the form of a dropdown menu, which saves space.
    • Additionally, there areImage UploadandFile uploadand other types, meeting your needs for uploading media resources.
  • Mandatory?:According to the importance of the field, you can check this item to require content editors to fill in this field when publishing content. This helps ensure the completeness of the content.
  • Default valueYou can set a default initial value for this field.It is worth noting that if the field type is 'single selection', 'multiple selection', or 'drop-down selection', you need to enter an option value here per line, and the system will automatically parse it as a selectable item.

After filling in all the information, click on theConfirm”to save your new field. Up to this point, a custom content model field has been successfully added to your Anqi CMS system.

The application of custom fields and template calls

Once the custom field is created, its value will immediately become apparent. When you enter the "Content Management" section again, while publishing or editing documents belonging to the content model, you will see the ".You can see the new field you just added in the foldable box, where you can enter the corresponding data.Content editors can easily fill in unique custom information for each article according to business needs.

When displaying this content on the website front end, the powerful template tag system of AnQi CMS makes it extremely convenient to call custom fields.

  • If you want to directly retrieve the value of a specific custom field, you can use{% archiveDetail with name="你的调用字段名" %}such a label. For example, to get the value of the 'Memory Capacity' field that we just created, you can use{% archiveDetail with name="memoryCapacity" %}.
  • If you want to dynamically cycle through all custom fields (for example, in a product parameter list), you can use{% archiveParams params %}Label. It will return an array containing all custom fields, and you can use them in the template throughforLoop throughitem.Name(i.e., parameter name, such as "Memory Capacity") anditem.Value(i.e., field value, such as '128GB').
  • For custom fields of image groups, for example, you have defined a field namedproductGalleryThe field for uploading multiple images, you can call it like this and loop to display images in the template:
    
    {% archiveDetail productImages with name="productGallery" %}
    <div class="product-gallery">
      {% for img in productImages %}
        <img src="{{img}}" alt="产品图片" />
      {% endfor %}
    </div>
    

Summary

The AnQi CMS custom content model field function provides great flexibility and powerful expansion capabilities for website operators.It makes content management no longer limited by fixed frameworks, able to closely fit the ever-changing business needs, and achieve true personalized content presentation.By flexibly using this feature, we can not only improve the efficiency of content publishing and optimize the information structure, but also provide users with more accurate and rich content experiences, thereby effectively enhancing the SEO performance and overall operational objectives of the website.Mastering this skill is undoubtedly the path to becoming an advanced operator of Anqi CMS.


Frequently Asked Questions (FAQ)

Q1: What should I do if the custom field I created does not appear on the content editing page? A1:Please confirm whether you have added the custom field to the correct model under "Content Management" -> "Content Model".For example, if you add fields to the 'Product Model', these fields will only be displayed when publishing or editing 'Product' content.In addition, on the content editing page, custom fields are usually located in the collapsible area labeled

Q2: Why is my custom field not callable in the front-end template? A2:The template call fails for several reasons. First, please check that the name of the 'call field' you use in the template matches exactly with what you have set up in the background, including the case.Secondly, ensure that the content of the page you are browsing is indeed part of the content model you added custom fields to.For example, if you add a field to the 'product model' but try to call it on the 'article model' detail page, you will not be able to retrieve the data.Finally, check if the field is already filled with data, if the field is empty, the front-end may not display any content.

Q3: Can I delete the built-in 'article model' or 'product model' of AnQi CMS system? A3:The 'Article Model' and 'Product Model' built into the AnQi CMS system are core models, which can modify their field definitions but cannot be deleted directly.However, you can add a custom model and modify or delete it.Before deleting any custom model, please be cautious, as deleting the model will also

Related articles

Why does the URL address of my image not change after replacement, but how can I check if the actual image file has been updated?

As an experienced website operation expert, I know that the efficiency and accuracy of content updates are crucial in daily work.Especially visual elements such as images are often the core of a website's ability to attract users and convey information.When we replaced an image in the Anqi CMS backend, we found that the URL address on the front page was still the old one. This 'URL unchanged' phenomenon can indeed be confusing and even make one doubt whether the update has really taken effect.

2025-11-06

How to dynamically obtain the base URL address of the website in the template (`BaseUrl`)?

As an experienced website operations expert, I have accumulated rich experience in the practice and application of content management systems (CMS), especially with the powerful functions and flexible features of AnQiCMS (AnQiCMS).Today, we will delve into a crucial issue in template development: how to dynamically obtain the base URL of a website (`BaseUrl`) and apply it to real-world scenarios.Dynamically retrieve `BaseUrl`: The Foundation of Website Flexibility In website operations

2025-11-06

Where is the `{API Key}.txt` file created under the `public` directory mentioned in `help-plugin-push.md`?

As an experienced website operations expert, I fully understand the importance of Search Engine Optimization (SEO) for website traffic and exposure.Among the many powerful functions of AnQiCMS (AnQi Content Management System), the link push tool is undoubtedly a tool to accelerate the inclusion of website content and improve search engine friendliness.Today, let's delve deeply into a seemingly minor but crucial detail in Bing Search Engine's proactive push - where is that `{API Key}.txt` file created under the `public` directory?

2025-11-06

How to determine the current template directory name so that it can be dynamically referenced in the template to access static resource paths?

Certainly, as an experienced website operation expert, I am happy to deeply analyze the strategy and practice of dynamically referencing static resource paths in Anqi CMS. --- ## The Beauty of Dynamics, the Art of Operations: How to Flexibly Refer to Static Resource Paths in AnQi CMS One of the core values of a content management system in website operations is to provide high flexibility and maintainability.How to efficiently and dynamically manage the paths of static resources (such as CSS, JavaScript, images, etc.) during template design and theme switching is an important indicator of a CMS's usability

2025-11-06

What content formatting options does the document editing interface of Anqi CMS support to enhance reading experience?

As an experienced website operations expert, I know that content is the soul of the website, and the way content is presented directly determines whether users can obtain information happily and efficiently.In this era of information explosion, producing high-quality content is not enough. We also need to use clever formatting techniques to make the content visually appealing and logically clear.AnQiCMS (AnQiCMS) is a tool that deeply understands content editing.

2025-11-06

How to use the 'recommended attributes' of Anqi CMS to increase content visibility and classification when adding a new document?

As an experienced website operations expert, I fully understand the core value of content in the digital age.The creation of high-quality content is indeed important, but how to make these contents efficiently reach the target users, achieve maximum exposure, and implement fine management is the key to operational success.AnQiCMS (AnQi CMS) is a powerful content management system that provides us with many conveniences in this aspect.Today, we will delve into a powerful yet often overlooked feature in AnQiCMS - the 'recommendation attribute', and see how we can cleverly use it to significantly improve content exposure and classification efficiency

2025-11-06

Can a dedicated document template and category template be specified when adding a new category in AnQi CMS?

In website content operation, personalized display is the key to attracting users and optimizing experience.We often encounter such needs: a certain type of content category needs a layout that stands out, or an important document needs a unique presentation.So, in Anqi CMS, when we add a new category, can we specify a dedicated document template and category template for it?

2025-11-06

How to add images and videos to the document editing interface of Anqi CMS and manage their storage?

As an experienced website operations expert, I know that in the era of content is king, multimedia content is important for attracting users, improving user experience, and optimizing search engines.AnQiCMS (AnQiCMS) is an efficient content management system that also provides powerful and flexible features in multimedia processing.Today, let's delve into how to easily add images and videos in the document editing interface of Anqi CMS, and comprehensively manage these valuable digital assets.

2025-11-06