As an experienced CMS website operation personnel in the security industry, I am well aware that in the digital age, diverse communication methods are the key to connecting with users and enhancing user experience.The Anqi CMS provides great flexibility in this aspect, whether it's the built-in contact information or the customizable social media channels, allowing your website to easily establish contact with visitors.

Next, I will detail how to add and call custom contact methods in the Anqi CMS, such as WhatsApp and Facebook.

Understand the contact information management of Anqi CMS

Add custom contact information in the Anqi CMS backend

To add WhatsApp, Facebook, or any other custom contact information you wish to display, you need to go to the admin interface of the Anqi CMS for the operation.

Firstly, please log in to your AnQi CMS backend. Find and click 'Backend Settings' in the left navigation menu, and then select 'Contact Information Settings'.

After entering the contact information setting page, you will see a series of default contact information input boxes.At the bottom of the page, there is usually an area called 'Custom Setting Parameters'.This area is where we add non-standard contact methods.

  • Parameter name:This is the unique identifier you use when calling this contact information in the website template.To ensure easy identification and invocation, it is recommended to use English letters for naming, for example, set 'WhatsApp' for WhatsApp, and set 'Facebook' for Facebook.The 'AnQi CMS' automatically converts letters to camel case naming (i.e., each word's first letter is capitalized without spaces), but it does not affect the direct use of the parameter names you enter in the template.
  • Parameter value:This is the specific content of the contact information. For example, for WhatsApp, you can enter your WhatsApp number, or a WhatsApp chat link containing the number (such ashttps://wa.me/您的电话号码)。For Facebook, you can enter the link to your Facebook homepage (such ashttps://www.facebook.com/您的主页名称).
  • Note:This field is only used by backend administrators to identify and record the purpose of this parameter, and it will not be displayed in the front-end template.You can fill in information such as 'WhatsApp link for the website footer' or 'Customer service Facebook page' for future maintenance and management.

After completion, save your changes. This way, your custom contact information has been successfully added to the AnQi CMS backend database.

Call custom contact information in the website template

Once the custom contact method is set up in the background, the next step is to display it on the front-end template of your website. Anqi CMS provides a special template tag for this.contact.

contactThe way to use tags is{% contact 变量名称 with name="字段名称" %}.nameThe value of the parameter is the "parameter name" you fill in the "Customize Setting Parameters" on the back end.

Here is an example of the code to call WhatsApp and Facebook contact information:

If you have set up the contact information with parameter names 'WhatsApp' and 'Facebook' under the 'Custom Settings Parameters' in the backend, and entered the corresponding links or numbers in the 'Parameter Values', you can use the following code to call them from any position in the template:

{# 直接调用WhatsApp联系方式 #}
<div>
    <span>联系WhatsApp:</span>
    <a href="https://wa.me/{% contact with name="WhatsApp" %}" target="_blank" rel="nofollow">
        {% contact with name="WhatsApp" %}
    </a>
</div>

{# 将Facebook链接赋值给变量后调用 #}
{% contact facebookLink with name="Facebook" %}
{% if facebookLink %}
    <div>
        <span>访问我的Facebook主页:</span>
        <a href="{{ facebookLink }}" target="_blank" rel="nofollow">
            Facebook
        </a>
    </div>
{% endif %}

In the above code:

  • {% contact with name="WhatsApp" %}The output will be the parameter value you set for 'WhatsApp' in the background. You can embed it intohrefIn the attribute, to create a clickable WhatsApp chat link.
  • {% contact facebookLink with name="Facebook" %}Assign the parameter values of Facebook tofacebookLinkVariable, which is very useful when you need to process or judge the data further.{% if facebookLink %}Check if a variable exists can avoid blank links or errors appearing on the page when background settings are not set.
  • target="_blank" rel="nofollow"Attributes are usually used for external links to ensure that a new tab is opened without leaving the current website and to inform search engines not to track this link, which helps with SEO.

You can place these code snippets in the website's header, footer, contact us page, or any area where you want visitors to see these contact details.In this way, the flexibility of Anqi CMS allows your website to easily integrate various custom social and communication channels, thereby better serving your visitors and business needs.

Common Questions

Q1: How can I add a contact method other than the default list of the security CMS, such as Telegram or Skype ID?

You can use the 'Contact Information Settings' option to implement the 'Custom Setting Parameters' feature.Just add a custom parameter on the "Contact Information Settings" page, set the "Parameter Name" to "Telegram" or "SkypeID", and then enter your Telegram username or Skype ID in the "Parameter Value".{% contact with name="Telegram" %}or{% contact with name="SkypeID" %}Call up this information.

Q2: Under the multi-site management mode of Anqi CMS, can I set different custom contact methods for different websites?

Yes, AnQi CMS supports multi-site management, and the "Contact Information Settings" for each site are independent.You can configure contact information separately for each site's backend, including default options and custom parameters.contactThe tag will automatically retrieve the contact information of the current site, if you need to cross sites