AnQiCMS (AnQiCMS) is an efficient and highly customizable content management system, one of its core highlights is the 'flexible content model'.This gives website operators powerful capabilities to deeply customize the structure and display methods of content according to actual business needs.In daily content operation, we often encounter situations where we need to add exclusive information for different types of content. In this case, the customized content model field function of Anqi CMS is particularly important, which makes our content management more refined and personalized.
Unique advantages of Anqi CMS content models
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 based on their unique business needs.This means that whether it is publishing regular industry articles, complex product detail pages, or corporate cases, event announcements, etc., we can tailor data structures for each type of content.This flexibility greatly enhances the adaptability of the system, allowing us to organize and present information in the most business logic-aligned manner.
However, the built-in fields of the system are ultimately limited.When our business develops to a certain stage, it may be necessary to record some more specific, non-standardized information, such as the 'launch time' of the product, 'target population', or the 'expert comments', 'reference sources' of the article, etc.At this moment, by adding a custom content model field, we can easily expand the existing content structure without touching the underlying code, and can incorporate these unique pieces of 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 that you are using an auto CMS to publish a product introduction about the latest model of mobile phone.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 'color' or 'storage version'.These 'Memory Capacity', 'Battery Life' etc., are custom fields.They make the content 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.
Firstly, you need to log in to the Anqi CMS backend management interface. After successful login, find the "" option in the left navigation menu.Content management" option and click to expand. You will see a name called "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 need is for a brand new content type, you can also click on the button 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 model, the next step is to enter the editing details page of the model. On this page, you will find an important area called the Custom fields of the content modelThis is where we add new fields.
Click "Add fieldButton, a new form will appear in front of you, where you need to define your new field:
- Parameter nameThis is the Chinese name of your custom field, which is also the name displayed on the back-end editing page to content editors. For example, if you want to add a field to record the memory capacity of a phone, the parameter name can be filled in as “Memory CapacityA clear parameter name helps the content team understand and use it.
- Call fieldThis field is the English identifier you use when calling this data in the front-end template.It must be alphabetic and unique within a model.
memoryCapacityThis name will be frequently used in subsequent template development, so it must be concise and descriptive. - field type:Security CMS provides various predefined field types to meet different data storage needs. Choosing the appropriate type is crucial:
- Single Line Text:适用于简短的文本输入,如产品型号、作者姓名。 English: For short text input, such as product model, author name.
- NumberIf you need to input pure numbers, such as prices, stock quantities, etc., selecting this type can ensure the accuracy of the data.
- Multi-line textEnglish for: Used for longer descriptive text, such as product features, detailed specifications, etc.
- Single selectionWhen you want users to select one option from a set of predefined options, for example, the 'color' (red, blue, green) of a product.
- Multiple selection:Allow the user to select one or more preset options, such as the 'size' (S, M, L, XL) of the product.
- Drop-down selection:Function similar to single choice, but presented in the form of a dropdown menu, which saves more space.
- In addition, there areImage uploadandFile uploadand other types, meeting your needs for uploading media resources.
- Is requiredAccording to the importance of the field, you can check this option to require the content editor 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 'Dropdown Selection', you need to enter an option value on each line here, and the system will automatically parse it into selectable items.
Fill in all the information and click on “OK”Save your new field. At this point, a custom content model field has been successfully added to your safety CMS system.
The application of custom fields and template invocation
Once the custom field is created, its value will immediately become apparent. When you enter the "content management" section again and publish or edit documents belonging to the content model, you will see in the editing page "Other parametersThe foldable box shows the new field you just added, for you to fill in the corresponding data.Content editors can easily fill in unique custom information for each piece of content according to business needs.
When displaying these contents on the website frontend, the powerful template tag system of Anqi CMS makes it extremely convenient to call custom fields.
- If you want to directly get the value of a specific custom field, you can use
{% archiveDetail with name="你的调用字段名" %}such tags. For example, to get the value of the 'Memory Capacity' field 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 %}标签。It returns an array containing all custom fields, which you can use in the template.forto iterateitem.Name(i.e., parameter name, such as "Memory Capacity") anditem.Value(即字段值,如“128GB”)。 - 对于图片组类的自定义字段,例如你定义了一个名为
productGalleryThe multiple image upload field, you can call it like this in the template and loop to display images:{% archiveDetail productImages with name="productGallery" %} <div class="product-gallery"> {% for img in productImages %} <img src="{{img}}" alt="产品图片" /> {% endfor %} </div>
Summary
The auto CMS custom content model field function provides great flexibility and powerful extensibility for website operators.It makes content management no longer limited by fixed frameworks, able to closely match the constantly 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 experience, thereby effectively enhancing the website's SEO performance and overall operational goals.Mastering this skill is undoubtedly the essential path to becoming a senior operator of Anqi CMS.
Common 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 "Other Parameters." You may need to click to expand to see them.
Q2: Why can't I call my custom field in the frontend template? A2:The template call fails usually for several reasons.Firstly, please check that the name of the 'Called Field' you use in the template is exactly the same as the one you have set in the background, including the case.其次,确保您正在浏览的页面内容确实属于您添加了自定义字段的那个内容模型。For example, if you add a field to the 'product model' but try to call it on the detail page of the 'article model', 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' in the 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 directly deleted.However, you can add a custom model and modify or delete it.