How should the 'parameter value' be filled in for the customized contact information in the AnQiCMS background to be correctly called in the template?

Calendar 👁️ 65

As an experienced website operations expert, I am well aware of how crucial it is to efficiently utilize each feature of a richly functional platform like AnQiCMS to serve the website content.Today

This is not just a technical detail, it also concerns the accurate presentation of website information and the smoothness of user experience.The AnQi CMS provided us with great flexibility, allowing us to flexibly display various contact information according to the actual needs of the website.

Flexible contact methods, efficient information transmission

In website operation, contact information is an important bridge connecting users and enterprises.In addition to the usual phone, email, and address information, many times we also need to display some personalized contact methods, such as customer service WeChat QR codes, WhatsApp accounts, online customer service links, and even some specific business cooperation email addresses.Contact information settingsThe module not only provides rich default fields but also allows usCustom settings parametersThis is the focus of this article.

When we enter the Anqi CMS backend, navigate to the "Contact Information Settings" under "Backend Settings", we will see a "Custom Setting Parameters" area.Here, we can add an unlimited number of personalized contact information based on business needs.Parameter NameHello WorldParameter valueAndNoteAmong them, the correct filling of 'parameter name' and 'parameter value' directly determines whether these information can be accurately called and displayed in the front-end template.

“Parameter name”: treasure map guidance in the template

"Parameter NameIt can be understood as the 'key' or 'variable name' you look for in the template. It tells the template engine which specific custom contact information you are looking for.

When filling in the "parameter name", Anqi CMS provides some very user-friendly handling mechanisms. Although you can directly fill in Chinese, such as "Customer Service WeChat QR Code", the system usually automatically converts it to a camel case naming that is more suitable for the programming environment (such asCustomerWeChatQrCode),or at least perform encoding processing. Therefore, as an experienced operator, my suggestion is:Try to use English and follow camel case namingFor exampleWhatsAppNumber/CustomerServiceLink/BusinessFaxand so on. The benefits of doing this are multifaceted:

  • Clear and concise:English parameter names are more universal and conducive for team members to understand and maintain.
  • Avoid ambiguity:Reduce compatibility issues that may arise due to Chinese in different systems or encoding environments.
  • Consistent with the template tag:When calling the tag in the template, thenameproperties are usually also in English to maintain consistency and avoid unnecessary errors.

This "parameter name" once set, becomes the unique identifier for calling the information in the template.

"Parameter value": the real content displayed to the user.

And "Parameter valueThis is the content that appears on the website page after successfully calling it through the "parameter name" in the template.It's like the real treasure you find on your treasure map.Output as isEnter the template, therefore, the way it is filled in needs to be determined according to the type of content you want to present.

Let us illustrate this with several specific examples:

  1. Plain text information:If you want to display a fax number, for example+86-010-12345678. Then simply fill in this number in the "parameter value".
    • Back-end settings:参数名: BusinessFax,参数值: +86-010-12345678
  2. A complete URL link:If you want to display a link to an online customer service, the user clicks on it and can directly jump to the customer service page. Then, you need to fill in the complete URL in the 'Parameter Value'.
    • Back-end settings:参数名: OnlineServiceUrl,参数值: https://chat.anqicms.com/
  3. A picture URL:If you want to display a WeChat customer service QR code image, then enter the complete URL address of the QR code image in the 'Parameter Value'.
    • Back-end settings:参数名: WeChatQrCodeImage,参数值: /uploads/images/wechat_qrcode.png(Here can be a relative path or an absolute path)
  4. Content with HTML tags: In some cases, you may want the 'parameter value' to directly contain some simple HTML tags, such as a linked text description.
    • Back-end settings:参数名: CustomContactInfo,参数值: 访问我们的 <a href="https://en.anqicms.com/contact">联系页面</a> 了解更多。

Remember, the Anqi CMS template engine is powerful, it will accurately render the parameter value you input. Therefore,The content filled in the “parameter value” is what is displayed after the template is called.

Accurately call the custom contact information in the template

After understanding the principles of setting up "parameter name" and "parameter value", the next step is how to present them in the front-end template. Anqi CMS provides a dedicated{% contact %}Tags to handle all background configuration contact methods.

The basic call format is:{% contact 变量名称 with name="字段名称" %}.

HerenameAttribute, which is the 'parameter name' we set in the background.

Let us demonstrate how to call the examples set earlier in the template:

  • Dial the facsimile number:

    <p>传真:{% contact with name="BusinessFax" %}</p>
    {# 或者,将值赋给一个变量再输出,这样更灵活 #}
    {% contact faxNumber with name="BusinessFax" %}
    <p>传真号码是:{{ faxNumber }}</p>
    
  • Call the online customer service link:

    <a href="{% contact with name="OnlineServiceUrl" %}" target="_blank">在线咨询</a>
    
  • Call the WeChat customer service QR code image:

    {% contact qrCodeUrl with name="WeChatQrCodeImage" %}
    <img src="{{ qrCodeUrl }}" alt="微信客服二维码" style="width: 120px; height: 120px;" />
    

    Please note that ifqrCodeUrlis a picture address, we need to use<img>tags to wrap it in order to display the picture correctly.

  • to call custom content that includes HTML tags:

    {% contact customInfo with name="CustomContactInfo" %}
    <p>{{ customInfo|safe }}</p>
    

    Pay special attention here|safeFilter. Because the "parameter value" may contain HTML tags, in order to make the browser parse it as HTML instead of plain text, we need to use|safeThe filter tells the template engine that this part of the content is safe and does not need to be escaped. Otherwise,<a href="...">it will be displayed directly on the page as text.

Summary and Practical Suggestions

By flexibly using the custom contact method function of the Anqi CMS backend, combined with the front-end template's{% contact %}Label, we can easily manage and display various personalized website contact information. The key is:

  1. "Parameter name"The key you use to reference this information in the template, it is recommended to use English camel case naming, and ensure consistency with thenameproperties strictly.
  2. “Parameter value”: Is the actual content displayed on the page, decide the filling method according to the content type (plain text, URL, image URL, HTML fragment, etc.). If it contains HTML tags, remember to use them in conjunction with the template.|safefilter.

Master these skills, and you will find website information management much easier, and content operation more efficient.


Frequently Asked Questions (FAQ)

Q1: Can the name of a custom parameter be written in Chinese? If it is written in Chinese, how can it be called in the template?

A1:The custom parameter name in the AnQi CMS backend can be filled in Chinese, but the system usually processes it internally. However, to** practice and avoid potential encoding issues, we strongly recommend using English and following camel case naming conventions. If you indeed use Chinese parameter names, such as “Online Customer Service Link”, then when calling it in the template, nameThe attribute usually needs to be filled with the English form converted internally by the system (for exampleOnlineCustomerServiceLink), or sometimes Chinese can be used directly, but this depends on the specific version and implementation.The most reliable method is to save the custom parameters in the background, then check the system prompts or try to call it using English camel case naming.

Q2: My custom contact parameter value is a picture URL, why does it only display the link address instead of the image in the template?

A2:The "parameter value" field stores plain text data, even if you enter an image URL, it is just a string. To display an image on a webpage, you need to use HTML's<img>Label. When calling this image URL parameter value in the template, it should be used as<img>label'ssrcAttribute value. For example, if your parameter name isWeChatQrCode, the parameter value is/uploads/images/qrcode.png, then you should write it like this in the template:<img src="{% contact with name="WeChatQrCode" %}" alt="微信二维码" />.

Q3: I have set up a custom contact method and called it in the template, but the front-end of the website does not display it. What could be the reason?

A3:In this situation, you can check from the following aspects:

  1. Is the parameter name consistent:Check if the "parameter name" you set in the background matches the template in{% contact with name="..." %}label'snameThe properties are exactly the same, including case. This is the most common mistake.
  2. Did it save correctly?Confirm that you clicked the 'Save' or 'Submit' button after modifying or adding contact information in the background.
  3. Template caching issue: Try to clear the system cache or browser cache of Anqicms, sometimes old cache data can cause the page content not to be updated.
  4. HTML structure issue: If your "parameter value" contains HTML tags (such as<a href="...">), but the template does not use them|safeA filter may cause the content to be displayed as plain text and even ignored by the browser. Please check if it has been added|safe.
  5. Syntax error:Check if the template file itself has any other syntax errors, which may cause the entire template parsing to fail. Through these steps, it is usually possible to locate and solve the problem.

Related articles

What are the naming conventions or suggestions when defining a custom contact method field?

In the powerful function ecosystem of Anqi CMS, the flexibility of custom contact information fields is undoubtedly a key factor in improving website operation efficiency.As an experienced website operations expert, I know that every detail can affect the overall performance of the website, and the naming conventions of 'parameter names', although seemingly trivial, are actually related to the maintainability, scalability, and smoothness of team collaboration of the website content.

2025-11-06

How to add a new custom contact field in the AnQiCMS contact information settings?

## Contact Information Setting for AnQi CMS: Easily add custom fields to meet your unique needs In the operation of a website, an efficient and personalized way of displaying contact information is often the key to establishing trust and promoting conversions between enterprises and users.AnQi CMS knows this, its powerful customizability allows you to easily go beyond default settings, add exclusive contact fields to your website, and ensure that your site perfectly fits the unique needs of your business.AnQi CMS is an efficient and customizable enterprise-level content management system that provides rich content models and SEO tools

2025-11-06

How to call the custom contact information field added in the AnQiCMS template?

The complete guide to calling the custom contact information field in AnQi CMS template: from backend configuration to frontend display As an experienced website operations expert, I know the importance of a flexible and efficient content management system for a corporate website.AnQiCMS stands out among many CMSs with its powerful custom capabilities and SEO-friendliness.It can not only help us easily manage content, but also seamlessly integrate various information configured in the background with the front end of the website through its flexible template mechanism.Today, let's delve into a very practical scenario

2025-11-06

Does the AnQiCMS contact information tag support displaying multiple custom social media accounts at the same time?

As an experienced website operation expert, I know that in an increasingly diversified digital age, whether a website can effectively connect with its audience largely depends on the breadth and convenience of its contact information.AnQiCMS (AnQiCMS) has always been committed to providing flexible and efficient solutions in content management, then, is the contact information label of AnQiCMS supported to display multiple custom social media accounts simultaneously?This specific question, my answer is: **Fully supported and very flexible

2025-11-06

What is the actual function of the 'remark' field in AnQiCMS custom contact information?

As an experienced website operations expert, I am well aware that every detail of a CMS system may have a profound impact on the operational efficiency and long-term maintenance of a website.AnQiCMS (AnQiCMS) has become a powerful assistant for many enterprises and self-media in content management, thanks to the efficiency and excellent expansion capabilities brought by the Go language.Today, let's talk about a seemingly insignificant feature in AnQi CMS that plays a huge role in actual operation - the "note" field in the custom contact information.### Flexible Contact Management

2025-11-06

Does the contact label support setting links to overseas communication tools such as WhatsApp?

As an experienced website operations expert, I am well aware that in the digital wave, enterprises need to maintain seamless connections with global customers.When it comes to configuring website contact information, especially the integration of overseas communication tools, the flexibility of AnQiCMS (AnQiCMS) always impresses me.Many friends will ask: Does AnQi CMS support setting links to overseas communication tools such as WhatsApp?My answer is: **Fully supported and very convenient to implement!

2025-11-06

How to configure contact links for social media such as Facebook, Twitter, etc. in the AnQiCMS background?

As an experienced website operations expert, I know the importance of every detail for website user experience and brand promotion.In the era of social media dominance, seamlessly connecting your website with major social platforms can not only broaden the channels of information dissemination but also enhance user interaction and brand influence.AnQiCMS (AnQiCMS) with its powerful flexibility and ease of use, provides us with an elegant solution.

2025-11-06

Is the AnQiCMS contact information tag integrated with emerging social platforms such as Tiktok, Pinterest, etc?

I am glad to discuss with you the capabilities of Anqi CMS in social media integration.As an experienced website operations expert, I fully understand the importance of keeping up with the times in online touchpoints for corporate brand promotion and user interaction.About whether the AnQiCMS contact information tag has integrated emerging social platforms such as Tiktok, Pinterest, etc.This question, I can give a clear and inspiring answer.

2025-11-06