In content management systems, flexibility is the key to improving operational efficiency and meeting individualized needs.AnQiCMS is proficient in this field and provides powerful custom parameter functionality, allowing users to flexibly extend content attributes according to their business characteristics and accurately display this information in front-end templates.This article will delve into how to set custom parameters in the Anqi CMS backend, as well as how to call them in the frontend templates to create a more expressive and functional website.


The magic of custom parameters: Flexible configuration and display of personalized content in Anqi CMS

In the ever-changing internet environment today, website content is no longer standardized output that is the same everywhere. Instead, it needs to show unique personality and depth according to different business scenarios and user needs.AnQiCMS (AnQiCMS) fully understands this, providing you with powerful custom parameter functions to easily expand content attributes, create highly customized information displays, thereby significantly improving website operational efficiency and user experience.

1. Set custom parameters in the background

The custom parameter settings of AnQi CMS are distributed across multiple key modules, aiming to meet the personalized needs of different levels and types.Understand the positions and functions of these settings is the first step to flexibly use custom parameters.

1. Custom fields in the content model: Add exclusive attributes for articles and products

This is the most commonly used and most important entry for custom parameter settings.Imagine that your website might have both ordinary articles and detailed product descriptions.Different types of content require different dedicated fields for description.

  • Set path: Go to the AnQi CMS backend, navigate to“Content Management”-“Content Model”[en] Here, you can choose to edit an existing model (such as "Article Model

  • Create a custom fieldIn the model editing interface, you will see a section named“Content Model Custom Fields”Click Add to start defining new fields.

    • Parameter nameThis is the field name displayed during background editing content, it should be clear and easy to understand, for example 'Article Source', 'Product Model', 'Real Estate Area', etc.
    • Call fieldThis is the unique identifier called in the front-end template, it is recommended to use concise English lowercase letters or camel case, such assource/modelNumber/area.
    • field typeThe : Anqi CMS provides various field types to accommodate different data formats:.
      • Single Line TextThe : It is suitable for short text information.
      • NumberThe : Ensure the numerical validity of the input content.
      • Multi-line textApplicable for longer descriptions or remarks.
      • Single choice/Multiple choice/Drop-down choiceWhen you need to preset some options for editing to choose from, these types are very useful. You can enter each option on a new line in the 'Default Value'.
    • Is required[en] Based on the importance of the field, decide whether to fill in the content when it is published强迫填写。
    • Default value[en] Set a default value for the field. If the content is not filled in during editing, this value will be automatically used。
  • [en] Application scenarios[en] When you are“Content Management”-Publish DocumentAfter selecting a content model that includes custom fields, these custom fields will appear on the document editing page.Other Parametersin the collapse box, for you to fill in.

2. Custom parameters in global settings: website-level personalized configuration

Some information is universally applicable across the entire site, not attached to a specific article or product, such as specific brand slogans, help page links, or statistics code switches, etc.

  • Set path: Go to“Backend Settings”-“Global Function Settings”.
  • Create custom parametersIn the bottom of the page, find theCustom setting parametersarea, where you can add new parameters.
    • Parameter nameIn the identifier as a template call, for exampleHelpUrl/BrandSlogan.
    • parameter value: The specific content of the parameter, such ashttps://en.anqicms.com/help.
    • [en] Note[en] :For internal management and understanding.

[en] 3. Custom parameters in the Contact Information settings: Expand your communication channels

In addition to the default contact information such as phone numbers, email addresses, etc., you may need to display more international contact methods, such as WhatsApp.

  • Set path: Enter“Backend Settings”-“Contact Information Settings”.
  • Create custom parameters: Similarly, find at the bottom of the pageCustom setting parametersAdd your desired contact information, such asWhatsAppand their corresponding contact numbers.

4. Custom parameters for single-page and category pages: detailed control at the page level

The AnQi CMS also allows you to add custom parameters for specific single pages or content categories.These fields will appear in the "Other Parameters" section of the corresponding single-page editing or category editing interface.For example, you can add a 'team slogan' field to the 'About Us' page, or add a 'feature advantage' description to a product category.The setting method is similar to the content model custom fields.

5.diyCustom Content Label: More generic content snippet

The Anqi CMS also provides a feature named "Custom Content" (corresponding to the front enddiyTags), used to manage some general and reusable content snippets, such as a fixed advertisement phrase, a small notice board content, etc. Although the document does not directly provide detailed instructions for the backend entry, its design philosophy is similar to the above custom parameters, that is, by defining a name and the corresponding value, in the template through{% diy with name="参数名" %}to call it.

Two, Flexibly call in front-end templates

Set up the backend parameters first, and then the next step is to present this personalized information to the visitor in the frontend template.The template engine of AnQi CMS (similar to Django syntax) provides concise and powerful tags and filters, making this process intuitive.

1. Call custom fields in content models

This is the most core calling scenario in the front end, mainly for detail pages such as articles and products.

  • Call specific field directlyIf you know the "call field" name of a custom field,{{archive.调用字段名}}or usearchiveDetailyou can get it by tag.

    • For example, you added a call field for the article model asauthorThe custom field, which can be directly used on the article detail page.{{archive.author}}to display the author.
    • Or use tags:{% archiveDetail with name="author" %}.
  • Loop through all custom fields.Sometimes, you might want to dynamically list: