How to obtain the detailed contact address of the website through the contact information label of AnQiCMS?

In the digital age, the contact information on a website is not just a string of information, but a bridge for communication with customers, and also the foundation for building brand trust.For many website operators who use AnQiCMS, how to efficiently and flexibly display these key information on the website frontend, especially the detailed contact address, is a common and important issue.幸运的是,AnQiCMS凭借其直观且功能强大的模板标签系统,让这一切变得异常简单。

The "Contact Information Tag" of AnQi CMS: Make Information Accessible

AnQiCMS knows the importance of content display flexibility for website operation, therefore it built a special function for getting contact information.contact

contactThe basic usage of tags is very intuitive:{% contact 变量名称 with name="字段名称" %}

Here is the “variable name” optional. If you want to store the data obtained into a temporary variable for subsequent processing, you can specify it.name="字段名称"It is the core, it tells the system which specific contact information you want to retrieve.

Behind the scenes: the data source of contact information.

In AnQiCMS backend, all these contact information are concentrated.“Backend Settings”of“Contact Information Settings”The module is managed uniformly.You can conveniently enter standard fields such as "contact personThese fields are the foundation of the contact information displayed on the website. Once entered in the backend, they become a data source that the front-end template can call at any time.

What's more worth mentioning is that AnQiCMS also supports.Customize settings parameters.This means that if your business has special requirements, such as displaying a specific business consultation hotline or a specific department's email address in addition to the standard contact information, all of these can be flexibly extended by adding custom parameters.These custom parameters are called in the same way as built-in fields, greatly enhancing the adaptability of the template, allowing your website information display to be unrestricted.

How to elegantly obtain and display detailed contact address?

To obtain the detailed contact address of the website, you just need to use in the AnQiCMS template file.contactTag, and specifynameparameter asAddressEnglish translation: Please note. For example, you may wish to display the specific address of the company on the footer or the "Contact Us" page.

{# 直接输出详细联系地址 #}
<div>公司地址:{% contact with name="Address" %}</div>

{# 将地址存储到变量中再输出,更灵活 #}
{% contact siteAddress with name="Address" %}
<div>我们的详细地址是:{{ siteAddress }}</div>

Through this method, the front-end page will automatically synchronize the display of the latest information regardless of how the contact address on the back-end is updated, thus eliminating the trouble of manually modifying the template.

The acquisition and display of other commonly used contact information

Of course, in addition to the detailed address,contactLabels can also help you easily obtain other important contact information. Imagine that your website visitors want to contact you by phone or email, you can display it like this:

  • Contact phone (Cellphone):

    <div>联系电话:<a href="tel:{% contact with name="Cellphone" %}">{% contact with name="Cellphone" %}</a></div>
    
  • Contact email (Email):

    <div>商务合作:<a href="mailto:{% contact with name="Email" %}">{% contact with name="Email" %}</a></div>
    
  • WeChat QR Code (Qrcode):For contact methods of image types, such as WeChat QR codes, AnQiCMS also provides a convenient way to obtain them. You only need to pass the address of the QR code image uploaded on the backend.name="Qrcode"Retrieve it and use it in the English<img>label as follows:

    {% contact wechatQrcode with name="Qrcode" %}
    {% if wechatQrcode %}
    <div class="wechat-qr">
        <img src="{{ wechatQrcode }}" alt="微信二维码" />
        <p>扫码添加微信</p>
    </div>
    {% endif %}
    
  • Custom Parameters:If you have created a custom contact method in the background, such as a method namedWhatsAppparameter, you can also use it in the template.{% contact with name="WhatsApp" %}Easily get and display it.

    <div>WhatsApp:{% contact with name="WhatsApp" %}</div>
    

Flexible application in multi-site scenarios

For users who operate multiple AnQiCMS sites, if you want to call in a template of a specific siteother sitesContact information,contacttags support ansiteIdParameters. By specifying the target site ID, you can flexibly retrieve data across sites, which is particularly practical for the group's official website or multi-brand management:

{# 获取ID为2的站点的联系地址 #}
<div>兄弟公司地址:{% contact with name="Address" siteId="2" %}</div>

Why is clear contact information crucial?

Efficiently and accurately displaying contact information is not only for the aesthetics of the website, but also a key link in improving user experience and search engine optimization.Clear and easily accessible contact information can increase users' trust in the website and reduce the bounce rate; at the same time, when search engines crawl structured contact addresses, phone numbers, and other information, it also helps to improve the visibility and ranking of the website in local search results, which is particularly important for local service-oriented enterprises.

In summary, AnQiCMS'scontact标签是一个功能强大且操作简便的工具,它将网站联系信息的管理和展示紧密结合,让网站运营者能够专注于内容的创造和业务的拓展,而不必为繁琐的代码而烦恼。Use this tag flexibly, and your website will be able to connect to the world in a more professional and convenient way.


Common Questions (FAQ)

  1. How to set or modify the contact address of the website on AnQiCMS backend?You just need to log in to the AnQiCMS backend, navigate to the "Backend Settings" menu, and then click "Contact Information Settings". Fill in or modify the contact address, phone number, email, and other information in the corresponding fields, and save it. The front-end page usescontactThe label information will be automatically updated.

  2. Besides the detailed contact address,contactWhat types of contact information can the label obtain? contact标签支持获取多种预设的联系信息,包括联系人姓名(UserName)、联系电话(Cellphone)、联系邮箱(Email)、微信号(Wechat)、微信二维码图片地址(Qrcode)、QQ号码(QQ),以及各大社交媒体(如WhatsApp、Facebook、Twitter等)的链接。Additionally, you can customize any additional contact methods in the background and call them using their custom 'parameter name'.

  3. If my website has multiple language versions, will the contact information label automatically switch languages? contactThe label itself is used to retrieve the contact information entered in the "Contact Information Settings" on the backend.Specific values,而不会自动进行语言翻译。如果您运营多语言网站,并且每个语言版本需要显示不同的联系信息,通常建议的方法是利用AnQiCMS的“多站点管理”功能,为每个语言版本设置一个独立的站点,每个站点配置各自语言的联系