How to retrieve and display the contact information, phone number, address, and email of the website?

Calendar 👁️ 97

In website operation, a clear and easily searchable contact method is a key factor in establishing user trust and promoting communication conversion.Whether it is seeking a partner for cooperation or a user in need of help, you can quickly find you through the contact information provided on the website.AnQiCMS provides flexible and convenient contact management and display functions, allowing you to easily obtain and display all kinds of contact information including contacts, phone numbers, addresses, emails, and more.

1. Manage your contact information centrally in the background

The Anqi CMS centralizes the contact information of the website, making it convenient for you to configure and update it uniformly. All contact information related to the website can be found in the "Backend settings" menu under the "Contact information settingsConfigure the page.

On this page, you will see a series of preset common contact fields, such as:

  • Contact (UserName): This is usually the name you want to display to others.
  • Contact Phone (Cellphone): This is your primary contact phone number, which users can call by clicking.
  • Contact Address (Address): The detailed address of the company, convenient for navigation or sending items.
  • Contact Email (Email): The address for receiving user emails.
  • WeChat account: Convenient for users to add your personal or corporate WeChat account.
  • WeChat QR code (Qrcode): Directly display the QR code, users can scan and add.
  • In addition, there are also various social media contact methods such as QQ, WhatsApp, Facebook, Twitter, Tiktok, etc.

If these default fields do not meet your business needs, AnQi CMS also provides powerfulCustom settings parametersFunction. You can add any new contact methods as needed, such as 'customer service hotline', 'online consultation link', or a specific business person in charge.When adding custom parameters, you need to set a "parameter name" as the identifier for calling in the template (recommend using English or pinyin, such asServiceHotlinePlease fill in the corresponding "parameter value" (actual contact information). This greatly enhances the flexibility of contact information display.

Secondly, call and display the contact information in the front-end template.

After you have completed the setup of the contact information in the background, the next step is to call and display it on the front page of the website. Anqi CMS provides a special template tag for this——contactLabel, its usage is very intuitive and flexible.

contactThe basic syntax of the tag is:{% contact [变量名称] with name="字段名称" %}.

  • nameThe parameter is the core you need to pay attention to, it corresponds to the English identification of the field in the background "Contact Information Settings" (for exampleUserName/Cellphone/Address/EmailOr it could be the parameter name you set when customizing.
  • You can optionally specify a 'variable name' for the contact information you obtain (for example,myContactPerson),so that the template code in subsequent templates can pass through{{myContactPerson}}Come to refer to this value multiple times to make the code more tidy. If it is not necessary to repeat the reference, you can also omit the variable name and output it directly in the label.

Let's look at some commonly used examples:

  1. Display contact name:If you want to display the contact name on the page, you can call it like this:

    {% contact with name="UserName" %}
    

    Or assign it to a variable and output it:

    {% contact myContactPerson with name="UserName" %}
    <span>联系人:{{ myContactPerson }}</span>
    
  2. Display contact phone number and add a dialing link:The contact phone number should not only be displayed, but also usually need to be convenient for users to click and dial directly.

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

    here,rel="nofollow"The attribute helps tell the search engine that this is a clickable link but not recommended.

  3. Display the company address:Display your detailed address directly on the page:

    {% contact with name="Address" %}
    
  4. Display the contact email and add an email link:Similar to the phone number, the email is often set to be clickable:mailtolinks.

    {% contact contactEmail with name="Email" %}
    邮箱:<a href="mailto:{{ contactEmail }}" rel="nofollow">{{ contactEmail }}</a>
    
  5. Display the WeChat QR code:If you upload a WeChat QR code, it can be displayed in the following way:

    {% contact wechatQR with name="Qrcode" %}
    {% if wechatQR %} {# 建议添加判断,如果后台未上传二维码则不显示 #}
    微信扫码:<img src="{{ wechatQR }}" alt="微信二维码" style="width: 120px; height: 120px;">
    {% endif %}
    
  6. Call a custom contact method (take WhatsApp as an example):Assuming you have customized one in the backgroundWhatsAppfield.

    {% contact whatsappNumber with name="WhatsApp" %}
    {% if whatsappNumber %}
    WhatsApp:<a href="https://wa.me/{{ whatsappNumber }}" target="_blank" rel="nofollow">{{ whatsappNumber }}</a>
    {% endif %}
    

    Here pass{% if whatsappNumber %}Determine, ensure that the front-end will display this part of the content only when the WhatsApp number is set in the background, to avoid displaying empty content.

Integrate contact information into the website page

Generally, the contact information of a website is displayed in the footer, the "Contact Us" page in the top navigation bar, or as a separate sidebar module.You can combine the above tags based on the overall design of the website and user habits.

This is an example of integrating multiple contact methods into a 'Contact Us' area:

<div class="contact-info-block">
    <h3>联系我们</h3>
    <ul>
        <li>
            <strong>联系人:</strong> {% contact with name="UserName" %}
        </li>
        <li>
            <strong>电话:</strong> <a href="tel:{% contact with name="Cellphone" %}" rel="nofollow">{% contact with name="Cellphone" %}</a>
        </li>
        <li>
            <strong>地址:</strong> {% contact with name="Address" %}
        </li>
        <li>
            <strong>邮箱:</strong> <a href="mailto:{% contact with name="Email" %}" rel="nofollow">{% contact with name="Email" %}</a>
        </li>
        {% contact wechatAccount with name="Wechat" %}
        {% if wechatAccount %}
        <li>
            <strong>微信号:</strong> {{ wechatAccount }}
        </li>
        {% endif %}
        {% contact wechatQR with name="Qrcode" %}
        {% if wechatQR %}
        <li>
            <strong>微信扫码:</strong>
            <img src="{{ wechatQR }}" alt="微信二维码" style="width: 100px; height: 100px;">
        </li>
        {% endif %}
        {% contact customHotline with name="ServiceHotline" %} {# 假设后台自定义了"ServiceHotline" #}
        {% if customHotline %}
        <li>
            <strong>客服热线:</strong> {{ customHotline }}
        </li>
        {% endif %}
    </ul>
</div>

By using the above method, you can easily manage and display the various contact information of the website in Anqi CMS, providing users with a convenient communication channel.Flexible backend configuration and simple template call tags enable website maintainers to efficiently respond to business changes, update contact information at any time, and maintain the accuracy of website information.


Frequently Asked Questions (FAQ)

Related articles

How to display the website name, Logo, filing number, and copyright information in Anqi CMS?

When operating a website, the website name, logo, filing number, and copyright information are core elements that constitute the brand image, establish user trust, and meet legal compliance requirements.For users of AnQiCMS, the system provides an intuitive and flexible way to manage and display this information, making your website not only rich in content but also professional and perfect in detail. ### One, centralized management: Configure these key information in the background One of the design philosophies of AnQi CMS is to make website management simple and efficient.

2025-11-08

How to get and display detailed information of a single Tag label (Title, Description, Logo)?

In AnQi CMS, tags (Tag) are an important way to organize and associate content.Sometimes, we need not only list the tags but also hope to display detailed information about a single tag on an independent page or in a specific area, such as its title, description, and even a representative logo.The AnQi CMS provides a concise and efficient method to meet this requirement. ### Understanding Tag Information Source In the Anqi CMS backend, you can configure the details for each tag.

2025-11-08

How to display the document list under the specified Tag label and implement pagination?

In AnQi CMS, the Tag (tag) function is an important tool for organizing and associating content, enhancing user experience and website SEO performance.When your website content becomes richer, how to effectively display the document list under a specified Tag and provide clear pagination navigation is crucial for the discoverability of content and the continuous browsing of users.This article will give you a detailed explanation of how to easily implement this feature by using several key template tags in AnqiCMS.

2025-11-08

How to retrieve and display all single page lists in AnQi CMS?

Managing and displaying single pages in Anqi CMS is one of the basic functions for website content construction.A single page is usually used to create pages with relatively fixed structures and independent content, such as 'About Us', 'Contact Information', or 'Service Introduction', etc.If you wish to display a list of single pages in a specific area of the website, such as the footer navigation or sidebar, AnQi CMS provides a very intuitive and flexible way to achieve this.

2025-11-08

How to set and display the TDK (Title, Description, Keywords) on the homepage of Anqi CMS?

In website operation, TDK (Title, Description, Keywords) play a crucial role, they are the first window for search engines to understand the content of the website, directly affecting the visibility and click-through rate of the website in search results.An optimally optimized TDK can not only improve the website's SEO performance but also accurately convey the core value of the website to potential visitors.AnQiCMS is a content management system that focuses on SEO optimization, providing users with a convenient and efficient way to set up and manage the TDK of the homepage.

2025-11-08

How to generate and display the breadcrumb navigation of the current page in Anqi CMS

When we browse websites, we often see a line at the top or bottom of the page indicating the current location path, such as “Home > Product Category > Electronic Products > Laptop”.This is what we commonly call 'breadcrumb navigation', which not only clearly informs us of our location but also makes it convenient for us to quickly return to the previous level page, greatly enhancing the website's user experience and navigation efficiency.In Anqi CMS, implementing and displaying breadcrumb navigation is a very easy thing to do.The system is built-in with special template tags that can intelligently adapt to the content structure of the current page

2025-11-08

How to create pagination navigation for document lists, Tag lists, and other Anqi CMS features?

In website operation, providing clear and easy-to-use pagination navigation for content lists not only greatly improves user experience but also optimizes search engine crawling efficiency, helping content to be discovered better.AnQiCMS (AnQiCMS) knows this and therefore provides powerful and flexible pagination tags in template design, allowing content operators to easily create pagination navigation for document lists, tag lists, and so on. We will discuss together how to implement this feature in AnQi CMS templates, organizing your website content neatly.--- ###

2025-11-08

How to implement language switching functionality for multilingual sites in Anqi CMS?

When our website is aimed at serving global customers, providing multilingual support has become an indispensable feature.This can not only help us expand the international market, but also significantly improve the access experience of users in different languages.AnQiCMS (AnQiCMS) fully understands this need, therefore, it has made multilingual support one of its core highlights, allowing us to easily build multilingual websites and switch languages.How to implement language switching for multi-language sites in AnQi CMS

2025-11-08