How to add custom fields of AnQiCMS content model to the document editing page?

Calendar 👁️ 49

As a deep user of Anqi CMS as a website operator, I know that the flexibility of the content model is one of its core advantages.AnQi CMS not only provides an efficient content management framework, but also enables us to easily expand and customize the content structure according to specific business needs, thereby realizing personalized content input and management on the document editing page.

Flexible content model: the foundation of AnQiCMS customization

The flexible content model feature of AnQi CMS is instrumental in meeting diverse content needs.The system has preset basic models such as 'Article Model' and 'Product Model', but its real strength lies in the fact that it allows us to create or modify exclusive content models for different types of content.Each content model is like a blueprint for content, defining what information this type of content should include, such as an article may need "author", "source", and a product may need "brand", "price", and so on.This additional information specific to the model is implemented through custom fields in the content model.

Define custom fields in the content model

To add a custom field to the document editing page, you first need to configure these fields in the Anqi CMS backend management interface.This is usually done by navigating to the 'Content Management' section under 'Content Model'.Here, we can choose to edit the existing content model or create a brand new one.

After entering the editing interface of a specific content model, you will see an area named "Content Model Custom Fields".This is where we define various personalized content attributes.When adding custom fields, it is necessary to clarify several key pieces of information:

  1. Parameter name (Chinese name)This is the friendly name displayed on the background interface for operation personnel, for example, 'article author', 'product brand', etc.
  2. Field call (English name)This is the actual name of the field stored in the database, as well as the identifier used when calling the field in the frontend template. It must use letters, such asauthor/brand.
  3. Field type: The Anqicms provides various field types to meet different data input requirements, including:
    • Single-line text: Suitable for short text input, such as titles, short links, etc.
    • Number: Only numeric input is allowed, suitable for prices, inventory quantities, etc.
    • Multi-line text: Suitable for longer text input, such as product descriptions, detailed explanations, etc.
    • Single choice: Allow multiple preset options, but only one can be selected, suitable for gender, status, etc.
    • Multiple selectionsAllow multiple options to be preset and selected multiple times, suitable for multi-label, multi-functional selection, etc.
    • Drop-down selection: Provide a dropdown menu where users select an option from predefined choices, similar to a single choice but differently presented in the interface.
  4. Mandatory?: You can choose whether this field is required to be filled in when the document is published.
  5. Default valueIf the field needs to preset a value, it can be entered here.For single choice, multiple choice, and drop-down selection fields, the default values here define the specific option content, with each option taking up a line.

After defining and saving the custom fields through the above steps, these fields are successfully attached to the corresponding content model.

Display of custom field on the document editing page

Once a custom field is defined in the content model, it seamlessly integrates into the document editing page associated with the model.When we select a specific category and start creating or editing a document, if the content model associated with that category contains custom fields, these fields will automatically appear in the 'Other Parameters' collapsible area of the document editing interface.

This means that whether it is to add an 'Editor in Charge' field for an article or to add a 'Material' option for a product, operation personnel can conveniently find and fill in these customized information on the same document editing page.This design greatly simplifies the process of content creation and management, ensuring the completeness and consistency of the information required for different types of content.

Invoke the custom field in the front-end template

The value of the custom field is not only reflected in the background data management, but also in their ability to flexibly present on the front page of the website.AnQi CMS provides powerful template tags, allowing us to easily display custom field content to users.

The most common way is to go througharchiveDetailThe tag directly calls the value of a specific custom field. For example, if we define a field namedauthorin the content model, we can use it in the template on the document detail page{% archiveDetail with name="author" %}Display author information.

For scenarios that require iterating through all custom fields, such as displaying a detailed parameter list of a product, you can usearchiveParamsLabel. This label will return an array object containing all custom field names and values, and we can iterate through it using a loop (forLabels) to dynamically display these parameters, greatly enhancing the flexibility and maintainability of the template.

In this way, we can ensure that the presentation form of the website content is highly consistent with the background management structure, realizing true personalized content display.

The Anqi CMS provides powerful content management tools for website operators with its highly flexible content model and intuitive custom field configuration.It not only makes content creation more refined, but also allows website content to better meet the needs of readers, ultimately attracting and retaining users through high-quality, personalized content.


Frequently Asked Questions (FAQs)

Ask: Can I change the type of a custom field after creating it?Answer: Anqi CMS allows you to modify the type of custom fields, but please operate with caution.Changing the field type may cause existing data to be lost or incompatible in format.For example, changing a field containing text to a 'number' type may cause the original text data to be incorrectly converted and displayed.Therefore, it is recommended to plan the field types in advance to avoid unnecessary modifications later.

Ask: What will happen if I delete a content model that contains a custom field?Answer: When you delete a content model, the system will prompt you that all documents and categories under the model will also be deleted.This means that all custom field data associated with these documents will also be cleared.Before performing this operation, please ensure that you have backed up the data and confirm that the deletion will not cause irreversible damage to the website content.

Ask: Does the custom field support multilingual?The custom field itself stores content in a single language.If you need to provide different custom field content for different language versions, the usual practice is to create independent documents for each language site in the multi-site management function of Anqi CMS, and fill in the corresponding custom field content for each language in these documents.Although the field itself does not provide built-in multilingual translation functionality, multilingual content management can be achieved through site separation.

Related articles

How to specify a unique display template for a single document in AnQiCMS?

As an experienced CMS website operation personnel of an enterprise, I know the importance of high-quality content for attracting and retaining users, and flexible content display is the key to achieving this goal.AnQiCMS provides many conveniences in content management, especially in specifying unique display templates for individual documents, it gives operators great freedom, allowing them to achieve fine-grained content presentation according to different content types and marketing strategies.

2025-11-06

What is the AnQiCMS document's canonical URL and when should it be used?

As a professional focused on content operations, we are well aware that every detail in search engine optimization (SEO) strategy can affect the visibility and traffic of a website.In the process of content creation and publishing, dealing with duplicate content is a common challenge.The canonical URL is one of the core tools to solve this problem, it can clearly tell search engines which page is the preferred version of the content, thus avoiding potential duplicate content penalties and concentrating the SEO weight of the page.

2025-11-06

How to set the SEO title, keywords, and description of the AnQiCMS document?

As a senior CMS website operations person in an enterprise, I know the importance of search engine optimization (SEO) for the successful operation of a website.The Anqi CMS was designed with SEO-friendliness in mind from the outset, incorporating a rich set of features to help operators efficiently set up and optimize the SEO performance of their websites.Today, I will elaborate in detail on how to set SEO titles, keywords, and descriptions in AnQiCMS based on the official documentation, as well as related URL optimization strategies.

2025-11-06

How to add and manage Tag tags in the AnQiCMS document?

As an experienced CMS website operation personnel of Anqi, I fully understand the importance of tags in content management and website optimization.Tags are not only an effective tool for organizing content, but also a bridge connecting users with relevant information, playing an indispensable role in improving user experience and search engine visibility.Next, I will elaborate on how to add and manage Tag tags in AnQiCMS, and how to flexibly use them on the website front-end.

2025-11-06

Can the document classification in AnQiCMS be changed to a different content model?

In the AnQiCMS content management system, document classification is the foundation for organizing and managing website content, closely linked to the content model, defining the structure and display of content together.It is crucial for website operators to clearly understand the relationship between classification and content models, especially regarding the issue of variability after creation.For the question 'Can the document category in AnQiCMS be changed to a different content model?'

2025-11-06

How to add a subcategory under AnQiCMS document classification?

As a senior website operator for AnQiCMS, I am well aware of the importance of content structure for user experience and search engine optimization.A clear and logical content classification can not only help users quickly find the information they need, but also enhance the professionalism and weight of the website.In AnQiCMS, by reasonably setting subcategories, an orderly content system can be effectively constructed. ### Build Content Hierarchy: Add Subcategories in AnQiCMS AnQiCMS provides flexible and powerful categorization features for content management.

2025-11-06

How to configure the SEO title, keywords, and custom URL for the AnQiCMS document classification?

As an experienced AnQi CMS website operation person, I know the key role of each page in search engine optimization (SEO).The category page acts as the core of the website content architecture, and its SEO performance directly affects whether your content can be efficiently discovered by potential readers.Our strong and flexible toolset provided by Anqi CMS can help us accurately configure SEO titles, keywords, and custom URLs for category pages, thereby significantly improving the visibility of the website in search engines.

2025-11-06

How does AnQiCMS set up independent templates for document categories?

As a professional who deeply understands the operation of AnQiCMS and has a profound understanding of website content operation, I know that fine-grained content display is the key to attracting and retaining users.The flexibility of AnQiCMS in template management, especially the ability to set independent templates for document classification, is an important tool for us to achieve our goal.In AnQiCMS, the setting of content category templates is not a one-size-fits-all solution, it follows a step-by-step, hierarchical overlay logic.

2025-11-06