How to add custom parameters and template calls in AnQiCMS global settings, excluding built-in parameters?

Calendar 👁️ 50

As an experienced senior CMS website operation personnel, I know that a content management system not only needs to meet the basic content publishing needs but also needs to have high flexibility and scalability to adapt to the constantly changing operation strategies.In AnQiCMS, in addition to the various built-in parameters, we often need to add some custom global parameters according to specific business scenarios and website design, so that we can flexibly call them in templates and achieve personalized content display.

Add custom global parameters in AnQiCMS backend

AnQiCMS provides an intuitive and simple way to extend global configuration, allowing operators to customize website-level parameters without modifying the core code.These custom parameters can be centrally managed and referenced as needed in any page template of the website.

To add custom global parameters, you need to log in to the AnQiCMS backend management interface and navigate to the "Global Function Settings" or "Contact Information Settings" module under "Backend Settings".At the bottom of these two modules, you will find an area named "Custom Setting Parameters".

Here, you can click the “Add” button to add new custom parameters. Each custom parameter contains three core fields:

  • Parameter Name (Parameter Name)This is the unique identifier used to call this parameter in the template. It is recommended to use lowercase letters and follow camelCase naming conventions (such ascustomTitle,companySlogan),to maintain code neatness and readability. The system will automatically convert the input letters to camel case.
  • Parameter ValueThis is the content you want the parameter to actually output. It can be any text, URL, number, or other information.
  • Remark (Remark)This field will not be displayed in the front-end template, its purpose is to help you better understand and manage the use of these custom parameters.A clear note can significantly improve team collaboration efficiency and future maintenance convenience.

For example, if you add a namedHelpUrlThe parameter value ishttps://en.anqicms.com/helpAnd add a note "link to the help document", then this custom parameter has been successfully added and can be used throughout the site. Similarly, if you add a named contact information settingWhatsAppThe parameter is used to display WhatsApp contact information, and it operates in the same way.

Call custom parameters in the AnQiCMS template

Once the custom parameters are set up in the background, they can be called through specific tags in the website template.The AnQiCMS template engine supports Django template engine syntax, making parameter calls very intuitive.

For custom parameters added in the "Global Function Settings", we mainly usesystemThe tag is used to call. This tag is specifically used to retrieve system-level configuration information, including built-in parameters and your custom global parameters.

For example, to call the previously added in the "Global Function Settings"HelpUrlYou can use the following template code for custom parameters:

{# 直接输出自定义参数的值 #}
<a href="{% system with name="HelpUrl" %}" target="_blank">帮助中心</a>

{# 将自定义参数赋值给一个变量后输出,适用于更复杂的逻辑处理 #}
{% system helpLink with name="HelpUrl" %}
<p>访问我们的帮助页面:<a href="{{helpLink}}" target="_blank">{{helpLink}}</a></p>

Similarly, for custom parameters added in the "Contact Information Settings", for exampleWhatsAppThen usecontactCall the tag.contactTags are used to retrieve all configurations related to the website's contact information.

Invoke the template code example for WhatsApp custom parameters:

{# 直接输出自定义的WhatsApp联系方式 #}
<p>WhatsApp联系方式:{% contact with name="WhatsApp" %}</p>

{# 将自定义参数赋值给一个变量后输出 #}
{% contact whatsappNumber with name="WhatsApp" %}
<p>紧急联系请拨打:{{whatsappNumber}}</p>

In this way, you can extract the text, links, and other information that need to be frequently updated or centrally managed on the website, and configure them as custom parameters.This not only reduces the complexity of template maintenance, but also improves the efficiency of website content updates and operational flexibility.When you need to modify a global piece of information, you only need to modify the parameter value once in the background, without having to delve into multiple template files to search and modify one by one.

Frequently Asked Questions

Q1: Why does the front-end page not update immediately after modifying the custom parameters?

A1: AnQiCMS to improve website performance, it will use cache to store configuration information.After you modify the custom parameters in the background, you may need to clear the system cache to make the changes take effect immediately.You can find the "Update Cache" feature in the AnQiCMS backend, click to execute.

Q2: Can I fill in HTML code in the 'Parameter Value' of a custom parameter?

A2: Yes, you can. The 'Parameter Value' field of the custom parameter supports input of HTML code.But when calling the template, if the HTML code contains tags that need to be explained (such as<script>or<a>),You may need to use|safeA filter that tells the template engine not to escape it, to ensure that HTML code can be rendered correctly. For example:{{customHtmlVar|safe}}.

Q3: How should I handle displaying different custom parameters based on different pages or content models?

A3: Global custom parameters are used to maintain consistent information throughout the entire site.If your requirement is to display different parameters for specific pages, categories, or content models, then it is recommended to use the AnQiCMS content model custom fields, category custom fields, or single page custom fields feature.These fields allow you to add unique parameters for specific content objects, and call them in their corresponding detail page or list page templates, thus realizing more refined content control.

Related articles

How to operate the website status (open/close) switch function of AnQiCMS, and how to customize the shutdown prompt?

As an experienced website operator proficient in AnQiCMS, I know that it is crucial to flexibly control the opening and closing status of the website and provide appropriate shutdown prompts during website maintenance, updates, or special situations, which is important for user experience and operation management.AnQiCMS provides intuitive and powerful features in this aspect, allowing us to easily meet these needs.### AnQiCMS website status switch feature operation guide In AnQiCMS, the website status switch is a core global feature that allows operators to need according to

2025-11-06

How to set up a separate domain for AnQiCMS backend to enhance security?

As a website manager who deeply understands the operation of AnQiCMS, I know that website security is crucial for any content platform.AnQiCMS (AnQiCMS) has always attached great importance to security from the beginning of the system design and has continuously iterated and optimized.Among them, setting up a separate domain for background management is one of the effective and necessary strategies to enhance the security level of the website and strengthen operation protection.This feature has been officially supported since AnQiCMS v2.1.1 version, aiming to provide users with stronger backend protection.

2025-11-06

How does the default language package setting of AnQiCMS affect the display of built-in text on the website?

In the daily operation of AnQiCMS, we know that the content of the website is not limited to articles and product information published by users, but also includes various built-in texts provided by the system.AnQiCMS as an efficient content management system, the default language package settings have a direct and important impact on the display of these built-in text.

2025-11-06

How to customize and display AnQiCMS copyright information in the website footer?

As an experienced CMS website operations manager for a safety company, I know that the copyright information in the website footer is not only an important part of legal compliance, but also an embodiment of brand professionalism.The Anqi CMS provides users with a flexible and convenient way to manage and display this information.Below, I will give a detailed introduction on how to customize and display the copyright information of the website footer in AnQiCMS.

2025-11-06

How to set and call the contact, phone number, and address information of the website in AnQiCMS?

As a senior security CMS website operator, I know that the contact information of the website is crucial for user trust and business conversion.A clear, accessible, and accurate contact method not only enhances user experience but also strengthens the search engine's trust in the website, thereby optimizing SEO performance.Now, I will introduce in detail how to set and call these key information in AnQiCMS.The contact, phone number, and address information on the website is an important bridge for corporate communication with the outside world.They not only show the real existence of the enterprise to visitors, but also provide users with help seeking

2025-11-06

What contact methods does AnQiCMS support, such as email, WeChat, QQ, and so on?

The configuration guide for common contact methods of AnQiCMS In the daily operation of websites, clear and convenient contact methods are key to establishing trust and communication between users and websites.As a website operator who has been deeply involved in the CMS of AnQi for many years, I know that high-quality content is not only reflected in the article itself, but also in every detail of serving users.

2025-11-06

How to add and call AnQiCMS custom contact information (such as WhatsApp, Facebook)?

As an experienced CMS website operation personnel, I know that in the digital age, diverse communication methods are the key to connecting with users and enhancing user experience.AnQi CMS provides great flexibility in this regard, whether it is built-in contact information or custom social media channels, it can easily establish contact with visitors on your website. Next, I will introduce to you in detail how to add and call custom contact methods in Anqi CMS, such as WhatsApp and Facebook.###

2025-11-06

How does AnQiCMS handle remote images in content, does it support automatic downloading to local?

As a senior CMS website operation personnel of an enterprise security company, I know that the management of images in the content is crucial for website performance and user experience.About how AnQiCMS handles remote images in content and whether it supports automatic downloading to local, I can clearly tell you that AnQiCMS provides very practical functions in this regard.In the AnQiCMS content management system, image processing is a core link, especially for content creators who need to refer to external image resources.The system has built-in management options for remote images

2025-11-06