How to obtain and display the contact information of the website in AnQiCMS, such as phone, email, address, and social media links?

Calendar 👁️ 62

It is crucial to clearly display contact information when building and operating a website, as it is essential for establishing user trust and providing customer support.AnQiCMS as an efficient content management system provides an intuitive way to manage and display this key information, whether it is traditional phone, email, or modern social media links, it can be easily realized.

One, background configuration:统一 manage your contact information

AnQiCMS has designed a centralized area, allowing you to manage all website contact information in one place. To access this feature, you just need to log in to the backend and find it through the left navigation bar.“Background Settings”and then clickthe "Contact Information Settings".

On this page, you will see a series of preset contact information fields, which are commonly used in website operations:

  • Contact: It is usually used for external titles, such as 'Mr. Wang.'
  • Contact phone number: A phone number that is convenient for users to dial directly.
  • Contact address: Display your company or service location.
  • Contact email: The email address for receiving user emails.
  • WeChat IDandWeChat QR code: Convenient for users to add WeChat contact.
  • QQ: Traditional instant messaging mode.

In addition, AnQiCMS also preset link fields for mainstream social media platforms such asFacebook, Twitter, Tiktok, Pinterest, Linkedin, Instagram, YoutubeFill in your social media homepage link as required.

Custom contact informationThe strength of AnQiCMS also lies in its high flexibility. If the preset fields cannot fully meet your personalized needs, for example, if you want to add a WhatsApp contact method or other unique contact channels, AnQiCMS allows you toCustom new setting item.

At the bottom of the "Contact Information Settings" page, you can find the "Custom Setting Parameters" area. Here, you can:

  1. Parameter NameThis is the name provided for the template, it is recommended to use English, for example 'WhatsApp'. The system will automatically process it into camel case.
  2. Parameter valuePlease fill in actual contact information, such as your WhatsApp number.
  3. NoteAdd a brief description for this custom parameter for your or team members to understand its purpose.

In this way, you can expand and update the contact channels of the website at any time according to business development or user preferences, ensuring the timeliness and accuracy of information release.

Second, front-end template call: easily display contact information

After configuring the contact information in the background, the next step is how to elegantly display these data on the front page of your website. AnQiCMS provides a very convenient template tag -contact.

contactThe core of tags lies in itsnameAttribute, you use it to specify the specific contact information field you want to retrieve. Below are some common contact method examples that you can embed in HTML code according to your template structure:

1. Basic contact information (phone, email, address)This information is usually displayed in the header, footer, or "Contact Us" page of the website:

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

<!-- 显示联系邮箱,并作为可点击的邮件链接 -->
<a href="mailto:{% contact with name="Email" %}">发送邮件:{% contact with name="Email" %}</a>

<!-- 显示联系地址 -->
<span>公司地址:{% contact with name="Address" %}</span>

2. Social media linksSocial media icons and links are standard features of modern websites:

<!-- Facebook 链接 -->
<a href="{% contact with name="Facebook" %}" target="_blank">访问我们的Facebook</a>

<!-- Twitter 链接 -->
<a href="{% contact with name="Twitter" %}" target="_blank">关注我们的Twitter</a>

<!-- 您也可以获取所有预设的社交媒体链接,并循环展示 -->
<!-- 注意:此功能需在后台的“联系方式设置”中配置“QQ”、“WhatsApp”等字段后才能正常调用 -->
<div class="social-links">
    {% contact contactInfo %}
        {% if contactInfo.QQ %}<a href="tencent://message/?uin={{ contactInfo.QQ }}&Site=&Menu=yes" target="_blank">QQ</a>{% endif %}
        {% if contactInfo.WhatsApp %}<a href="https://wa.me/{{ contactInfo.WhatsApp }}" target="_blank">WhatsApp</a>{% endif %}
        {% if contactInfo.Facebook %}<a href="{{ contactInfo.Facebook }}" target="_blank">Facebook</a>{% endif %}
        <!-- ...以此类推,调用其他社交媒体字段 -->
    {% endcontact %}
</div>

3. WeChat QR codeQR codes are usually displayed as images, so you need to present them as<img>label'ssrcattribute values:

<!-- 显示微信二维码图片 -->
<img src="{% contact with name="Qrcode" %}" alt="微信二维码" style="width: 100px; height: 100px;">

4. Custom Contact InformationIf you have added custom parameters in the background, such as "WhatsApp", you can also use them throughcontacttag to call:

<!-- 显示自定义的WhatsApp联系方式 -->
<span>WhatsApp联系:{% contact with name="WhatsApp" %}</span>

Tip: Assign data to variablesIf you need to use the same contact information in multiple places in the template, or want to perform some additional processing after obtaining it, you can assign it to a temporary variable to make the template code more concise:

{% contact phoneNumber with name="Cellphone" %}
<p>我们的电话是:{{ phoneNumber }}</p>
<a href="tel:{{ phoneNumber }}">立即拨打</a>

Calling in a multi-site environmentFor users who manage multiple sites through AnQiCMS,contactTags also supportsiteIdparameter. This means you can call the contact information of another site in a template of a site, just by specifying the correspondingsiteIdand it is done:

<!-- 调用站点ID为2的联系电话 -->
<span>站点2电话:{% contact with name="Cellphone" siteId="2" %}</span>

Chapter 3: Optimization and Precautions

  • Maintain consistency of information: AnQiCMS centralized contact information management, greatly simplifies the update process.Any contact information change only requires one-time modification in the background, and all calls to the label on the front end will be automatically updated, avoiding inconsistencies in information.
  • Enhancing user experience: Set phone numbers, email addresses, and other links as clickable (such astel:andmailto:Protocol can significantly enhance the user experience on mobile devices, allowing them to quickly initiate contact.
  • Beneficial for SEO: Clear and easily accessible contact information, also very beneficial for search engine optimization (SEO).Search engines will recognize this information, which helps improve the visibility of the website in local search results.
  • Design integrationMake sure to integrate this contact information into the appropriate locations of the page design, such as the footer, navigation menu, sidebar, or a dedicated "Contact Us" page, ensuring that the information is both prominent and aesthetically pleasing.
  • Test availabilityBefore the website goes live, please make sure to test the display and click effects of these contact methods on different devices and browsers to ensure everything works properly.

By using the above method, you can fully utilize the functions of AnQiCMS, efficiently manage and display the contact information of your website, provide users with a convenient communication channel, and help the success of website operation.


Frequently Asked Questions (FAQ)

1. I changed the contact information in the background, but the front page did not update immediately, why is that?This is usually caused by the cache mechanism of AnQiCMS.To improve the website loading speed, the system will cache some data.After you modify the background settings, you may need to manually clear the cache to make the front end effective immediately.You can find it in the left navigation bar of the AnQiCMS backend“Update Cache”Option, click it to clear the website cache.

2. Besides phone and email, what social media links does AnQiCMS support? How can you add more social media platforms not listed here?AnQiCMS supports default mainstream social media links such as Facebook, Twitter, Tiktok, Pinterest, Linkedin, Instagram, Youtube, etc. If you need to add social media that are not in the default list or any other custom contact methods, you can useThe 'Contact Information Settings' page has the 'Custom Setting Parameters' feature at the bottom. Just add a new custom parameter, enter its name (such as "SnapchatLink"), the corresponding value (your Snapchat link), and notes, then use it in the template through{% contact with name="SnapchatLink" %}Call the tag to invoke it.

3. How to make the phone number clickable and dial directly on mobile?In the template, you can use HTML'stel:An agreement is used to implement this feature. For example, after you get the phone number:

{% contact phoneNumber with name="Cellphone" %}
<a href="tel:{{ phoneNumber }}">点击拨打:{{ phoneNumber }}</a>

Then, click this on a mobile device:

Related articles

How to retrieve and display the system global settings of AnQiCMS template, such as website name, Logo, filing number, and copyright information?

When building a website, some core information such as the website name, website logo, filing number, and copyright information are indispensable elements.These global settings not only help visitors quickly identify your brand, but also reflect the professionalism and compliance of the website.AnQiCMS provides a straightforward and flexible way to manage and present these system-level information in templates.Where can I set these global information?First, these important website information need to be unified configured in the AnQiCMS background.

2025-11-07

How to retrieve and display the list of Tag tags and their corresponding links for an article?

In a website with increasingly rich content, how to effectively organize and present information is crucial.The Tag label (usually referred to as keywords or tags) not only helps users find related content quickly, but is also an indispensable part of Search Engine Optimization (SEO).AnQi CMS understands this point, providing users with a powerful and flexible tagging function, allowing you to easily add tags to articles and display these tags and their corresponding links in multiple forms on the website front end.

2025-11-07

How to dynamically retrieve and display the content of custom model fields for an article in a template?

In AnQi CMS, the flexibility of website content is one of the key advantages for our content operation and website layout.By customizing content model fields, you can add unique properties for different types of content (such as articles, products), which can better reflect your business needs.But how can we dynamically present these carefully defined custom field contents in the front-end template of the website?This article will discuss this topic in detail, helping you fully utilize the powerful functions of AnQiCMS.

2025-11-07

How to retrieve and display a list of articles under a specific category (or multiple categories) in AnQiCMS?

In AnQiCMS, flexibly displaying website content is the key to improving user experience and website functionality.No matter if you are running a corporate website, a personal blog, or a marketing site, you often encounter the need to display a list of the latest articles, popular products, or multiple related category content under a specific category on a particular page.AnQiCMS's powerful template tag system, especially the `archiveList` tag, can help you easily achieve this goal.

2025-11-07

How does AnQiCMS use the `navList` tag to build and display multi-level website navigation menus?

When building a website with comprehensive functions, a clear and intuitive navigation menu is the core of user experience.AnQiCMS provides a powerful template tag system, where the `navList` tag is specifically used to build and display a multi-level navigation menu for the website.It not only can display the navigation structure you configure in the background, but also help you convert technical details into user-friendly interactive experiences.### The Foundation of Building Navigation: Backend Settings Before using the `navList` tag, you first need to set up in AnQiCMS

2025-11-07

How to display breadcrumb navigation in AnQiCMS template and customize the home page name or whether to include the current page title?

Have you ever felt a bit confused while browsing websites, not knowing where you are?Breadcrumb Navigation is like leaving a series of small markers along the way as you explore a new place, making it clear where you came from and where you are now.It can significantly enhance the user experience of the website, help visitors quickly understand the website structure, and is very beneficial for search engine optimization (SEO), as it provides clear website hierarchy information for search engine spiders.

2025-11-07

How AnQiCMS dynamically generates and displays page Title, Keywords, and Description (TDK) to optimize SEO?

In website operation, to make your content stand out in search engines, attract more target users, and cannot do without the careful setting of these three core elements: Title, Keywords, and Description (TDK).AnQiCMS knows the importance of TDK for SEO, and has integrated a complete dynamic TDK generation and management mechanism from the beginning of the system design, allowing you to flexibly and efficiently optimize every page of your website.

2025-11-07

How to enable multilingual support for AnQiCMS website and display language switch options in the front-end template?

Under the wave of globalization, websites no longer only serve local users. How to allow visitors from different language backgrounds to access and understand the content of the website without barriers has become an important challenge for many operators.AnQiCMS (AnQiCMS) fully understands this need, providing a flexible and powerful multilingual support solution to help websites easily expand into the international market.This article will introduce how to enable multilingual functionality on the AnQiCMS website and guide you to integrate language switching options in the front-end template to enhance user experience.

2025-11-07