In the process of building and operating a website, displaying contact information is often a crucial aspect.It is not only a bridge for visitors to communicate with you, but also a key factor in building trust and improving conversion rates.AnQiCMS (AnQiCMS) understands this need, providing basic contact information settings while also giving users great flexibility, allowing you to customize and display various contact information according to your unique business needs.
This article will guide you to deeply understand how to set custom contact information parameters in Anqi CMS to meet the specific information display needs of your website template.
Why do you need a customized contact method?
In the digital age, the contact channels of enterprises are far more than just phone and email.Your business may need to display various contact channels other than traditional phone and email, such as links to specific social media accounts (such as Line ID, WhatsApp number), dedicated customer service hotlines for specific regions, contact information for different departments, or even cryptocurrency receipt addresses.The design philosophy of Anqi CMS is to provide a highly customizable content management solution, with its flexible content model and tagging system, which is precisely to meet these diverse needs.When the preset contact information field of the system cannot fully cover your business scenario, custom parameters become an indispensable tool for you.
By customizing parameters, you can ensure that the contact information displayed on the website's front end always aligns with your actual operational strategy. No matter how your business develops, you can quickly and easily adjust and expand it without modifying the template code or seeking help from technicians.
Add custom parameters in AnQi CMS backend
First, let's understand how to add these custom contact information parameters in the AnQi CMS backend management interface.
Enter the contact information settings page:Log in to your AnQi CMS backend, find the "Backend Settings" menu in the left navigation bar.Click to expand and you will see the "Contact Settings" option, click to enter the corresponding configuration page.
Familiarize yourself with the existing fields and the "Custom Settings Parameters" area:After entering the contact information settings page, you will see some preset fields, such as contacts, phone numbers, contact addresses, contact emails, WeChat ID, etc.These are the most commonly used basic information on the website. These default fields have met the needs of most websites.
However, the real magic lies in the 'Custom Setting Parameters' area at the bottom of the page. This is where you create personalized contact information.
Create a new custom parameter:In this area, you will see a 'Add Custom Parameter' button or a similar entry. Click on it, and several input boxes will appear for you to fill in:
- Parameter name:This is the "name" you will use when calling this information in the template. It is strongly recommended to use English letters and camel case naming (for example:
WhatsAppContact/ServiceHotline/LineID}. Even if you enter Chinese, the system usually automatically converts it to camel case naming, but using English directly is more intuitive and convenient. - Parameter value:Enter the specific content you wish to display. This could be your WhatsApp number, a dedicated customer service hotline link, an email address for a special department, or any text content you need to show.
- Note:This field is purely for your own management and memory convenience, for example, you can fill in "WhatsApp contact information for overseas users", "dedicated hotline for VIP customers", etc., which will not be displayed on the front-end website.
For example, if your business is mainly aimed at overseas users, you need to provide WhatsApp contact information, and you can fill in the parameter name in it
WhatsAppFill in your WhatsApp number in the "Parameter Value".- Parameter name:This is the "name" you will use when calling this information in the template. It is strongly recommended to use English letters and camel case naming (for example:
Save your settings:After filling in, don't forget to click the 'Save' or 'OK' button at the bottom of the page to make your custom parameters effective.
Call custom parameters in the website template.
After completing the backend settings, the next step is how to display these custom information on the website frontend. The AnQi CMS template engine is similar to Django syntax, using{% 标签 %}Performing logical control,{{ 变量 }}Performing data output.
Anqi CMS provides a very convenientcontactThe label is used specifically to call contact information, whether it is a preset field or a custom parameter you have just created.
Basic syntax for calling custom parameters:
{% contact 变量名 with name="您的自定义参数名" %}
Or, if you don't need to assign a value to an intermediate variable, you can directly output:
{% contact with name="您的自定义参数名" %}
Let's take the previously setWhatsAppparameter as an example:
If you set the parameter name in the background,WhatsApp, the parameter value is+8613800138000Then in your website template (such as the footerfooter.htmlor on the "Contact Us" pagecontact.htmlyou can call it like this:
<p>
WhatsApp 联系我们:
{% contact whatsappNumber with name="WhatsApp" %}
<a href="https://wa.me/{{ whatsappNumber }}" target="_blank" rel="nofollow">{{ whatsappNumber }}</a>
</p>
or more succinctly:
<p>
WhatsApp 联系我们:
<a href="https://wa.me/{% contact with name="WhatsApp" %}" target="_blank" rel="nofollow">{% contact with name="WhatsApp" %}</a>
</p>
This will dynamically display "WhatsApp Contact Us: +8613800138000" on your website, and clicking the number will directly jump to the WhatsApp chat.
If the custom parameter is an image address (for example, a WeChat QR code):
Assuming you have customized a parameter name in the backgroundWechatQrCodeImgThe parameter value is the link to the WeChat QR code image you uploaded to the Anqi CMS image library (for example:/uploads/2023/01/wechat_qrcode.webp)。In the template, you can display it like this:
<div class="wechat-qrcode">
<p>微信扫码咨询:</p>
<img src="{% contact with name="WechatQrCodeImg" %}" alt="微信二维码" />
</div>
In this way, you can flexibly place custom parameters at the top, bottom, contact us page, or even any article or product detail page where you need to display this information, greatly enhancing the richness and practicality of the website content.
Summary
The contact information customization feature of Anqi CMS combines the flexibility of backend configuration with the ease of use of frontend templates巧妙地It allows website operators to easily expand and manage the contact information of their website, meeting various unique business needs without delving into complex code modifications.This high degree of customization is exactly the core value of Anqi CMS as an enterprise-level content management system, committed to helping small and medium-sized enterprises and content operation teams improve efficiency and reduce costs.
Frequently Asked Questions (FAQ)
1. Can the 'parameter name' of a custom parameter be in Chinese? What if it is?Although when setting custom parameters in the AnQi CMS background, the "parameter name" field can be entered in Chinese, the system will usually automatically convert it to camel case naming format in English. We strongly recommend using English letters with clear meanings as parameter names (for exampleServiceHotlineInstead客服热线This can avoid potential compatibility issues and make the template code clearer, easier to maintain, and understand.
2. How should I set and call a custom contact method that is an image (such as a dedicated customer service QR code)?You can directly enter the complete URL address of the image in the 'Parameter Value' of the custom parameter (for example, the link to the image you upload to the Anqi CMS media library). When calling the template, just use the parameter value as<img>label'ssrcProperty can be, for example:<img src="{% contact with name="您的图片参数名" %}" alt="自定义二维码" />This way, the image