In the digital age, a high-efficiency, professional website is a key bridge for enterprises to communicate with users.AnQiCMS (AnQiCMS) is an enterprise-level content management system based on the Go language, deeply understanding this field, not only providing strong content management capabilities, but also considering the operators in detail.Today, let's delve into a seemingly simple yet extremely practical feature: how to add custom parameters in the contact information settings of AnQiCMS, making your website information display more flexible and tailored to business needs.

Flexible configuration, making contact information not uniform

In website operations, a company's contact information is the foundation for building trust and promoting communication.However, the preset contact information field often fails to meet the personalized needs of all enterprises.Perhaps you need to display a dedicated WhatsApp number, or a specific Telegram ID, or even an account on an uncommon industry communication platform.AnQiCMS understands the importance of personalization and therefore provides a highly flexible custom parameter function to perfectly match your contact information settings to business scenarios.

To begin customizing your contact information, first you need to log in to the AnQiCMS admin interface. In the left menu bar of the back end, find and click on the “Backend settingsPlease select an option from the dropdownContact information settings.

After entering the "Contact Information Settings" page, you will see some commonly used contact information fields preset by AnQiCMS, such as contact person, phone number, address, email, WeChat ID, and WeChat QR code.These default fields meet most basic needs and make it convenient for you to quickly fill in and display the core contact information of the enterprise.

Add custom parameters: Expand your communication channels

The true flexibility is reflected in the "Custom settings parameters" area.This is the stage where you create a dedicated contact method according to your specific business needs.You can imagine that your business needs to highlight a specific customer service hotline number, or it could be an uncommon social media account, or even an instant messaging tool commonly used in international business, such as a "Skype ID".By custom parameters, all of these can be easily achieved.

There are several key elements to note during the process of setting custom parameters:

The first is the quotation markParameter NameThis is the unique identifier used when calling the custom contact method in the template.To ensure the accuracy and consistency of template calls, we strongly recommend that you use English letters for naming, and AnQiCMS will automatically convert them to camel case (for example, if you entercustomer hotlineThe system will automatically process it asCustomerHotlineAlthough the system also supports Chinese parameter names, using English naming would be a better practice from a long-term maintenance and development perspective

The next isParameter valueThis is the specific content you want to display on the website front-end. For example, if you set the parameter name to 'Customer Service Hotline', then the parameter value can be filled in.400-123-4567If the parameter name is 'Skype ID', then the parameter value can be your Skype username.

Finally is "NoteThis field is not displayed on the website front-end. It is purely for the convenience of you and your team to better understand the purpose and meaning of this parameter.Clear notes can effectively improve the efficiency of background management, especially when there are many custom parameters, which can help you quickly identify the function of each parameter.

For example, suppose you want to add a dedicated 'customer service hotline' phone number on your website. You just need to click add in the 'custom settings parameters' area, then fill in the 'parameter name' in the boxCustomerHotline(or your desired English name), enter it in the 'Parameter Value' box400-123-4567And note in the "notes" the "24-hour customer service hotline". This way, a completely new custom contact method is configured.

Display custom parameters on your website.

It is not enough to set the parameters in the background; you also need to present them on the website's frontend page to truly make it work.AnQiCMS through simple and powerful template tags makes this process easy.

In your template file, AnQiCMS provides a namedcontactThe dedicated tag, serving as a bridge between backend contact settings and frontend display.Whether it is the default contact method or the custom parameter you just created, it can be called through this tag.

To call a default contact method, such as a phone number, you can write:

<span>联系电话:{% contact with name="Cellphone" %}</span>

Here, name="Cellphone"Specified is the preset "contact phone" field you want to retrieve.

And for the parameters you define, the calling method is equally intuitive. For example, the 'customer service hotline' parameter, its parameter name isCustomerHotline. You can call it like this in the template:

<span>客服专线:{% contact with name="CustomerHotline" %}</span>

The system will accurately output here based on the "parameter value" you set in the background400-123-4567.

If you are operating multiple sites and want to call the contact information of other sites on a specific site,contactTags also supportsiteIdParameters allow you to precisely control the data source, but in most cases, you do not need to manually specify this parameter.

Enhance user experience and operational efficiency

By setting up the custom contact method through AnQiCMS, your website will be able to provide richer and more user-friendly communication channels.This not only improves user experience and enhances user stickiness, but also significantly improves the efficiency of enterprises in handling consultations and services.In order to provide strong support for your multilingual communication channels for global business or for exclusive service channels provided for segmented markets, this feature of AnQiCMS can offer you strong support.

Frequently Asked Questions (FAQ)

1. Can I use non-English characters as parameter names? For example, can I use 'Customer Service Hotline'?AnQiCMS supports you to enter non-English characters as 'parameter name', the system will automatically convert it to camel case for template calling. For example, if you enter 'customer service hotline', the system may process it internally asKeFuZhuanXianor a similar form. However, in order to maintain the uniformity and readability of the template code, we stillstrongly recommendUsing English letters as parameter names helps avoid potential encoding issues and makes it easier for developers to maintain templates.

2. Why doesn't the website front-end display the custom parameters I added?This usually has several reasons:

  • Cache problem:Please first try to clear the system cache of AnQiCMS. Find the "Update Cache" in the top menu bar of the backend and click it. It is also recommended to clear your browser cache.
  • Template call error:Check the custom parameter calls in your template file.{% contact with name="..." %}Is the tag correct? Make sure.nameThe value of the attribute is exactly the same as the 'parameter name' set in the background (pay attention to the case).
  • The template file has not been updated:Make sure that the template file you have modified has been uploaded to the server correctly and is effective.
  • Front-end code is missing:You may have only set the parameters in the background, but did not add the correspondingcontacttags in the front-end HTML/Twig template to display it.

How to add an icon next to a custom contact method?AnQiCMS'contactThe label is responsible for outputting the text content of the "parameter value" you set in the background. If you want to add an icon next to the text, this needs to be done in your template file, surroundingcontactThe output of the tag, implemented manually using HTML and CSS. For example:

<span class="contact-item">
    <i class="fas fa-headset"></i> <!-- 这是一个Font Awesome图标示例 -->
    客服专线:{% contact with name="CustomerHotline" %}
</span>

You need to include the corresponding icon library's CSS file (such as Font Awesome) in the website and control the size and color of the icons through CSS styles.