How to set custom parameters in the background and flexibly call them in the front-end template to display specific information?

Calendar 👁️ 66

In a content management system, flexibility is the key to improving operational efficiency and meeting personalized needs.AnQiCMS (AnQiCMS) is well-versed in this, providing powerful custom parameter functions, allowing users to flexibly expand content attributes according to business characteristics, and accurately display this information in front-end templates.This article will discuss in detail how to set custom parameters in the Anqi CMS backend and how to call them in front-end 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 today's rapidly changing internet environment, website content is no longer standardized and uniform, but needs to show unique personality and depth according to different business scenarios and user needs.AnQiCMS (AnQiCMS) understands this and provides powerful custom parameter functions for you, allowing you to easily expand content properties, create highly customized information displays, thereby significantly improving website operation efficiency and user experience.

1. Set custom parameters in the background

The custom parameter settings of AnQi CMS are distributed across multiple key modules, aimed at meeting the personalized needs of different levels and types.Understanding the location and function of these settings is the first step in flexibly using custom parameters.

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

This is the most commonly used and most important custom parameter setting entry.Imagine that your website might have both regular articles and detailed product introductions.Different types of content require different dedicated fields to describe.

  • Set path: Enter the Anqi CMS backend and navigate to“Content Management”-u003e“Content Model”. Here, you can choose to edit an existing model (such as 'Article Model', 'Product Model'), or create a new content model.

  • Create custom fieldsIn the model editing interface, you will see an area named“Content model custom field”. Click add to start defining new fields.

    • Parameter Name: This is the field name displayed during the background editing, should be clear and understandable, such as "source of article", "product model", "house area", etc.
    • Field invocationThis is the unique identifier used to call this parameter in the front-end template, it is recommended to use concise lowercase letters or camel case naming, for examplesource/modelNumber/area.
    • Field type: Anqi CMS provides various field types to adapt to different data formats:
      • Single-line text: Suitable for short text information.
      • Number: Ensure the validity of the numerical values in the input content.
      • Multi-line text: Suitable for long descriptions or notes.
      • Single choice/Multiple choice/Dropdown choice: When you need to preset some options for editors to choose from, these types are very useful. You can enter each option on a new line in the "default value".
    • Mandatory?:According to the importance of the field, decide whether to fill in the content when it is published.
    • Default value:Set a default value for the field, which will be automatically used if it is not filled in during content editing.
  • Application scenario:When you are“Content Management”-u003e“Publish document”After selecting a content model that includes custom fields, these custom fields will appear on the document editing page.“Other Parameters”in the collapse box for you to fill in.

2. Global settings custom parameters: website-level personalized configuration

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

  • Set path: Go to“Background Settings”-u003eGlobal function settings.
  • Create custom parametersFind at the bottom of the page,"Custom Setting Parameters"Area, you can add new parameters.
    • Parameter NameAs a template call identifier, for example,HelpUrl/BrandSlogan.
    • Parameter valueThe specific content of the parameter, such as,https://en.anqicms.com/help.
    • NoteFor internal management and understanding convenience,

3. Set up contact information with custom parameters: Expand your communication channels

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

  • Set path: Enter“Background Settings”-u003ethe "Contact Information Settings".
  • Create custom parameters: Similarly, find at the bottom of the page."Custom Setting Parameters"Add the contact information you need, for exampleWhatsAppand its corresponding contact number.

4. Custom parameters for single pages 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 edit or category edit interface.For example, you can add a "team slogan" field to the "About Us" page or add a "feature advantage" description for a product category.The way it is set up is similar to the custom field of the content model.

5.diy(Custom Content) label: A more generic content snippet

AnQi CMS provides a feature named "Custom Content" (corresponding to the front-enddiyTags), used to manage some common and reusable content snippets, such as a fixed advertisement, a small notification bar content, etc. Although the document does not directly provide detailed instructions for the backend entry, its design concept 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.

Second, flexibly call in the front-end template

After setting up the background parameters, the next step is to present this personalized information to the visitor in the front-end template.The AnQi CMS template engine (similar to Django syntax) provides concise and powerful tags and filters, making the process intuitive.

1. Call the custom fields in the content model

This is the most core calling scenario in the front-end, mainly for article, product and other detail pages.

  • Directly call a specific fieldIf you know the name of the custom field "call field", you can directly go through{{archive.调用字段名}}or usearchiveDetailtags to obtain.

    • For example, you have added a call field called for the article modelauthorCustom field, 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 may want to dynamically list

Related articles

How does the navigation settings support creating navigation at different locations to meet the diverse content display needs of the website?

In website operation, the navigation system plays a crucial role, it is not only the map for users to explore the content of the website, but also the key for search engines to understand the structure of the website.A well-designed navigation can significantly improve user experience, guide users to discover more interesting content, thereby extending visit time, and indirectly help the website's SEO performance.AnQiCMS provides a user-friendly and powerful navigation settings feature, allowing you to flexibly build various types of navigation to meet the diverse content display needs of the website.### Core Concept: Flexible Construction of Navigation AnQiCMS

2025-11-08

How to handle images (download remote, Webp, compress large images) to optimize page display speed in content settings?

As website operators, we all know that website loading speed is important for user experience and search engine rankings.Especially on content-rich websites, images are often a key factor affecting page speed.AnQiCMS (AnQiCMS) provides us with several very practical image processing features in the content settings, allowing us to flexibly optimize images and significantly improve the display speed of the website. ### Localizing remote images, controlling image resources During the process of content creation, we sometimes refer to images from other websites. At this time

2025-11-08

How to configure custom rewrite rules to create more SEO-friendly content URLs?

The importance of URL structure in website operation is self-evident.A clear, concise, and keyword-rich URL not only improves user experience but also makes it easier for users to remember and share content, and can significantly optimize the crawling and ranking effects of search engines.Aqicms is well aware of this, therefore it provides a flexible and powerful pseudo-static rule configuration function to help users create more SEO-friendly content URL displays.What is the pseudo-static URL and its importance?So-called pseudo-static is not a real static page, but refers to URL rewriting technology through the server

2025-11-08

How does the search engine link push feature help new documents be indexed and displayed in search results quickly?

On the day of content release, how can your meticulously crafted website content be quickly discovered and indexed by search engines, which is a focus for every content operator.A newly released article or product page, if it can appear quickly in the search results, it will undoubtedly seize the initiative and bring valuable early traffic.AnQiCMS (AnQiCMS) fully understands this need and has specially provided a search engine link push feature to help your new document reach the search engine as quickly as possible, thereby speeding up indexing and display.Why is it important to be indexed quickly?

2025-11-08

How to configure independent SEO information and template display for a single page (such as "About Us") in the page management?

In website operation, each page has its unique value and goal.For pages such as "About Us", "Contact Us", and "Terms of Service", they often carry brand stories, core values, or important contact information, which are crucial for building corporate image and user trust.Therefore, configuring exclusive SEO information and personalized display templates for these specific pages is an effective way to enhance the professionalism and user experience of the website.AnQiCMS deeply understands these needs, providing flexible and powerful functions, allowing you to independently configure SEO information and specify personalized template display for each single page

2025-11-08

In document management, how is the recommended attribute `flag` used to control the display of content on the homepage or other special locations?

In Anqi CMS, the "recommended attribute" (`flag`) is a powerful and flexible feature that allows you to finely control the display of website content on the homepage, category pages, or other specific display areas.Understanding and effectively using this attribute can significantly improve the content operation efficiency and user experience of your website.What is the "recommended attribute" (`flag`) in Anqi CMS?In the Anqi CMS document management module, when you add or edit a document, you will find an option named "recommended properties".These attributes are not traditional classifications or tags

2025-11-08

How to configure multi-site content display in AnQiCMS

Easily implement multi-site content management and display in AnQiCMS It is a challenge for users who operate multiple brands, sub-sites, or content branches to manage the content of each site uniformly.AnQiCMS provides powerful multi-site management features, allowing you to easily create and maintain multiple independent websites under a single system instance and flexibly control the display of their content.This article will give a detailed introduction on how to configure multiple sites in AnQiCMS and achieve independent management and display of content.### 1. Prepare the work

2025-11-08

How to randomly get a character or value from a string or array?

In Anqi CMS template design, we often encounter the need to dynamically display content, such as randomly recommended articles, randomly displayed product images, or randomly selecting one from a set of preset keywords for display.To achieve this flexible and varied content presentation, Anqi CMS provides simple and powerful template filters, including the `random` filter that can randomly select a character or value from a string or array.Understand and master the `random` filter, which can make our website content more vibrant and fresh, effectively enhancing the user experience

2025-11-08