How to retrieve and display the contact information set in the background (such as phone number, email, WeChat)?

Calendar 👁️ 94

It is crucial to clearly display contact information in website operations to enhance user trust and promote interaction.Whether it is to consult products, seek support, or conduct business cooperation, a convenient contact channel can greatly improve the conversion rate.AnQiCMS (AnQiCMS) knows this and provides flexible and powerful features that allow you to easily obtain and display various contact information in website templates.

Next, let's take a look at how to display the contact information set in the background of Anqi CMS, such as phone, email, WeChat, etc., naturally and smoothly on your website.

Step 1: Set your contact information in the background

First, you need to make sure that all contact information has already been entered in the Anqicms backend.This is the place where you can centrally manage important information on your website, making it convenient for you to update and maintain it at any time.

Log in to your Anqi CMS backend, and you will find a menu named “Backend settings”. Click to enter, and you will find a special option called “Contact information settings.

Here, the system has preset some commonly used contact fields, such as:

  • Contact
  • Contact phone number
  • Contact address
  • Contact email
  • WeChat ID
  • WeChat QR code
  • QQ
  • as well as some social media likeWhatsApp, Facebook, Twitter, Tiktok, Pinterest, Linkedin, Instagram, Youtubeetc.

You only need to fill in your actual information in these corresponding input boxes.For example, enter your company phone number in the "Contact Phone" field, enter the customer service email in the "Contact Email" field, and then upload your WeChat QR code image.

If the existing fields do not meet your needs, for example, if you want to add a "corporate customer service hotline" or an "online consultation link", you can also use the bottom "Custom settings parametersFunction. Here you can customize the "parameter name" (this name will be used for template calls, it is recommended to use English or pinyin, such asCustomerHotlinePlease fill in the parameter value (i.e., the content you want to display) and add a note for future identification.

After completing all information entry and adjustments, please make sure to click save, so that your contact information is successfully stored in Anqi CMS.

Step 2: Call and display in the template

When your contact information is set up properly in the background, the next step is to display it in the website template.AnQi CMS provides simple template tags, making this process very easy.

The template of AnQi CMS follows a syntax similar to the Django template engine, variables are enclosed in double curly braces{{变量}}, the label uses single curly braces and percent signs{% 标签 %}. For calling the background settings contact information, we mainly use a very convenient label:contact.

contactThe basic usage of tags is:{% contact 变量名称 with name="字段名称" %}Where the variable name is optional, if you do not define it, the label will directly output the value of the field.If you define a variable name, you can use this variable in the subsequent code.nameParameters, which are the field names you see when you set them up in the background (such asCellphone/Email/Wechat/Qrcode), as well as the parameter names you customize.

Let's look at a few specific examples to understand how to use it:

1. Display contact phone number

You may want to display the company's contact phone number on the website footer or the 'Contact Us' page.

<p>联系电话:<a href="tel:{% contact with name='Cellphone' %}" rel="nofollow">{% contact with name='Cellphone' %}</a></p>

here,href="tel:..."Is an HTML standard, click to make a phone call directly on the phone,rel="nofollow"Is a practice that is friendly to search engines.

2. Display contact email

Similarly, displaying your corporate email is also very simple.

<p>联系邮箱:<a href="mailto:{% contact with name='Email' %}">{% contact with name='Email' %}</a></p>

mailto:The link allows users to click and directly open the email client to send an email.

3. Show WeChat ID

If your business needs to contact through WeChat, you can directly display the WeChat ID.

<p>微信号:{% contact with name='Wechat' %}</p>

4. Display WeChat QR code image

For the WeChat QR code, you need to display it as an image.srcDisplay properties.

<div class="wechat-qrcode">
    <img src="{% contact with name='Qrcode' %}" alt="微信二维码" />
    <p>扫码添加微信</p>
</div>

5. Display your custom contact information

If you have customized a name in the backgroundCustomerHotlineThe parameter is used to display the customer service hotline, and it is also convenient to call it in the template:

<p>客服热线:{% contact with name='CustomerHotline' %}</p>

6. Integrate and display multiple contact methods

Generally, we would集中展示多种联系方式 on the footer of the website or a dedicated “Contact Us” page.You can combine the above calling methods to create a clear contact information area.

<div class="contact-info">
    <h4>联系我们</h4>
    <ul>
        <li>电话:<a href="tel:{% contact with name='Cellphone' %}" rel="nofollow">{% contact with name='Cellphone' %}</a></li>
        <li>邮箱:<a href="mailto:{% contact with name='Email' %}">{% contact with name='Email' %}</a></li>
        <li>微信:{% contact with name='Wechat' %}</li>
        {%- if contactWhatsapp = {% contact with name='WhatsApp' %} %} {# 检查WhatsApp是否存在 #}
            <li>WhatsApp:<a href="https://wa.me/{% contact with name='WhatsApp' %}" target="_blank">{% contact with name='WhatsApp' %}</a></li>
        {%- endif %}
    </ul>
    {%- if contactQrcode = {% contact with name='Qrcode' %} %} {# 检查微信二维码是否存在 #}
    <div class="wechat-qrcode-container">
        <img src="{{ contactQrcode }}" alt="微信二维码" />
        <p>扫码添加微信</p>
    </div>
    {%- endif %}
</div>

We used here{%- if ... %}Make a judgment to ensure that the corresponding contact information is set in the background before it is displayed on the front end, to avoid blank spaces or broken links, and also make the code more robust.{%- endif %}of-The symbol is used to remove the extra blank lines generated by the tag, making the code rendering cleaner.

Practical tips

  • Choice of placement.The website footer, header navigation, sidebar, or a standalone "Contact Us" page are all ideal locations to display contact information.Choose the place that is easiest to access based on the design of your website and user habits.
  • Multi-site management: If you use Anqi CMS's multi-site feature to manage multiple websites and want to call the contact information of a specific site, you can do so by specifying thecontactthe tag withsiteId="站点ID"parameters such as{% contact with name='Cellphone' siteId="2" %}This way, you can accurately obtain contact information from different sites.
  • Real-time update: The backend settings and frontend display of AnQi CMS are closely related.After you modify the contact information in the background, the front-end page will usually update immediately, without the need for complex cache cleaning operations, unless you have enabled a special static page cache strategy.
  • Usability and consistencyKeep your contact information consistent across the entire site, which helps establish brand credibility.At the same time, ensure that this information is easy for users to find and use, which is the key to improving the user experience.

By using the flexible settings and powerful template tags provided by AnQi CMS, managing and displaying your website's contact information has become unprecedentedly simple and efficient.


Frequently Asked Questions (FAQ)

1. I have set up the contact information in the background, why is it not displayed on the front page?

This is usually caused by the following reasons:

  • The template tags are not added or used incorrectly:Please check if your template file has added correctly{% contact with name="字段名称" %}the tags, andnamethe parameter is consistent with the field name set in the background (including case).
  • The background setting has not been saved:Make sure you modify the information after changing it on the "Contact Information Settings" page in the background

Related articles

How to configure and display the website name and copyright information in AnQi CMS?

A website's name and copyright information is an important embodiment of its brand image and legal attribution.In AnQiCMS (AnQiCMS), these core elements are configured and displayed flexibly and intuitively, which can help website operators manage easily, ensuring the professionalism and compliance of the website. ### Configure website basic information In AnQiCMS, the basic configurations such as website name, copyright information, and so on are mainly concentrated in the "Global Function Settings" area of the background.Here is like the 'control center' of your website, centrally managing many core parameters.1. **Website Name**

2025-11-07

How to display the website's logo and filing information?

In the construction of a website, the website logo and filing information are indispensable components.The logo is not only a visual identifier for a brand, helping users quickly recognize and remember your website, but also the record information reflects the compliance and authority of the website, especially in mainland China, website record is the basis for legal operation.AnQi CMS as an efficient and easy-to-use content management system fully considers these core needs and provides a concise and clear way to configure and display these key information.--- ### Configure Logo and Filing Information in AnQi CMS Backend First

2025-11-07

How to implement adaptive, code adaptation, and independent template display for PC and mobile terminals in AnQiCMS?

In the era when mobile internet dominates, whether a website can provide a consistent and high-quality experience across different devices is directly related to user retention and brand image.AnQiCMS fully understands the needs of users for multi-platform experience, and therefore integrated flexible and diverse template display modes from the beginning of system design, helping users easily cope with challenges of various terminals such as PC, mobile phone, and so on.AnQiCMS provides three core template display modes, namely: adaptive mode, code adaptation mode, and independent template mode for PC and mobile terminals.These three modes have their respective focuses

2025-11-07

How to customize the overall display template of AnQi CMS?

AnQi CMS provides a flexible and powerful template customization mechanism, allowing you to create a unique website style according to your actual needs.No matter whether you want to adjust the overall layout or display personalized design for specific content, Anqi CMS can provide clear paths and rich tools to support your creativity.One of the core advantages of AnQi CMS is its template engine.It adopts syntax similar to Django and Blade, which allows those familiar with web development to get started quickly.This syntax is intuitive and easy to understand, outputting data through `{{variable}}`

2025-11-07

How to configure and display SEO title, keywords, and description (TDK) on the website homepage?

In website operation, the search engine optimization (SEO) of the homepage is crucial.A well-configured SEO title, keywords, and description (TDK) can significantly improve the visibility of a website in search engine results pages (SERP), attracting more potential visitors.AnQiCMS (AnQiCMS) is a system designed for SEO-friendliness, providing an intuitive and convenient way to manage key information.This article will guide you to understand how to configure and display SEO title, keywords, and description on the homepage of your AnQiCMS website.--- ### One

2025-11-07

How to generate and display multi-level breadcrumb navigation in AnQi CMS?

In website content operation, a clear navigation path is crucial for user experience and search engine optimization.A good breadcrumb navigation can help users quickly understand the current page's position in the website structure and make it convenient for them to backtrack to the previous level or higher-level pages.AnQiCMS (AnQiCMS) fully understands this, therefore it provides a powerful and easy-to-use breadcrumb navigation feature that allows website administrators to easily generate and display multi-level breadcrumbs.The core of implementing breadcrumb navigation in Anqi CMS lies in its built-in `breadcrumb` tag

2025-11-07

How to dynamically generate and display the top or bottom navigation menu of a website?

In website operation, the top and bottom navigation menus play a vital role. They are not only guides for users to explore the website's content but also crucial for search engines to understand the website's structure.A well-designed, dynamically generated navigation menu that can greatly enhance user experience and website maintainability.AnQiCMS provides a set of intuitive and powerful features to help you easily achieve this goal.### Backend Configuration: Bring Your Menu to Life To dynamically generate and display navigation menus in AnQi CMS, you first need to configure the menu content in the backend

2025-11-07

How to retrieve and display a list of articles or products in a loop?

Build an energetic website in AnQiCMS, the display of the content list is an indispensable part.Whether it is to display the latest released articles, hot products, or content under specific categories, AnQiCMS' powerful template engine can help us easily achieve it.This article will delve into how to retrieve and loop through lists of articles or products in AnQiCMS, helping you flexibly build diverse content display pages.## Understanding AnQiCMS content list mechanism AnQiCMS uses a template engine syntax similar to Django

2025-11-07