How to set contact information in AnQiCMS and display it on the front page (such as phone number, address, WeChat)?

Calendar 78

In today's digital age, a website's contact information is not just for displaying information, but also a bridge for communication between businesses and customers.Clear and easily accessible contact information can effectively enhance customer trust and promote business conversion.AnQiCMS (AnQi Content Management System) knows this and provides a simple and efficient way to set up and display various contact methods, whether it's phone, address, or WeChat.

Let's take a step-by-step look at how to configure and display these key information in AnQiCMS.

Step 1: Set your contact information in the background

First, we need to enter the contact information into the AnQiCMS backend system. This process is very intuitive.

  1. Log in to the AnQiCMS backend:Log in to the AnQiCMS management interface using your admin account.
  2. Navigate to the contact information settings:In the navigation menu on the left, find the [Background Settings], then click to expand, and you will see the [Contact Information Settings] item.Click to enter, this is where you manage all the contact information for your website.

After entering the [Contact Information Settings] page, you will see some preset common fields, such as:

  • Contact: Usually used for addressing, such as “Mr. Wang” or “Customer Service Team”.
  • Contact Phone:The phone number you want the customer to call.
  • Contact address:The detailed address of your company or physical store.
  • Contact Email:Customers can contact your address via email.
  • WeChat ID:Your corporate or personal WeChat account.
  • WeChat QR Code:You can upload a WeChat QR code image for easy scanning by customers.

You can fill in your information according to your actual situation.

Custom contact information:In addition to these common fields, AnQiCMS also provides great flexibility, allowing you to add custom contact information.For example, if you want to display WhatsApp numbers, Facebook homepage links, or other social media accounts, you can use the 'Custom Settings Parameters' function at the bottom of the page.Click on 'Add Custom Parameter' and you will see three input boxes:

  • Parameter name:This is the name for template calling, it is recommended to use English, for example.WhatsApp/FacebookLink. The system will automatically convert it to camel case.
  • Parameter value:Enter the corresponding contact information, such as the WhatsApp number or the full URL of the Facebook homepage.
  • Note:This is an internal note for you and your team to understand the purpose of this parameter, it will not be displayed on the front end.

Complete the form and remember to click the [Save] button at the bottom of the page to ensure that all your changes have taken effect.

Step 2: Display your contact information on the front page.

After setting up the contact information, the next step is to display them on the front page of the website.AnQiCMS uses a concise syntax similar to the Django template engine, easily calling back-end data through specific 'tags'.

Core tags:contact

In AnQiCMS template files, you can usecontacttags to retrieve the contact information previously set in the background. Its basic usage is:

{% contact 变量名称 with name="字段名称" %}

Here:

  • 变量名称An optional parameter is used to store the obtained value in a variable for repeated use in the template.
  • 字段名称This is a required parameter, it must match the field name you filled in in the background [Contact Settings] (whether preset or custom), for exampleCellphone/Address/Wechat/QrcodeOr you can customize itWhatsApp.

Here are some common display examples:

1. Display contact information:You can add phone information in the footer or 'Contact Us' page and make it clickable for mobile users to call directly.

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

here,rel="nofollow"The attribute helps tell the search engine that this link does not pass weight, usually used for non-content links.

2. Display company address:

<p>
    地址:{% contact with name='Address' %}
</p>

3. Display WeChat ID:

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

4. Display WeChat QR code:For contact methods of image type, such as WeChat QR code, you need to use<img>tags to display. At the same time, to ensure that the image can be rendered correctly, it is recommended to use|safefilter.

{%- comment %} 先尝试获取二维码图片链接,并存储到 qrcode 变量中 {%- endcomment %}
{%- contact qrcode with name='Qrcode' %}
{%- if qrcode %} {%- comment %} 判断 qrcode 变量是否有值,有值才显示 {%- endcomment %}
<div class="wechat-qrcode">
    <img src="{{ qrcode|safe }}" alt="微信二维码" style="width: 100px; height: 100px;">
    <p>扫码添加微信</p>
</div>
{%- endif %}

Here we first try to get the QR code image link and assign it toqrcodevariable. Then, by{% if qrcode %}the judgment.qrcodeThe variable exists, and the image is displayed only when it exists.|safeThe filter is crucial here, as it tells the template engine to output the string as safe HTML content directly, avoiding the special characters in the URL being escaped and causing the image to not display.

5. Show Custom WhatsApp Link:If you have set a custom parameter name in the background:WhatsAppand filled in the WhatsApp chat link, you can call it like this:

{%- contact whatsappLink with name='WhatsApp' %}
{%- if whatsappLink %}
<p>
    WhatsApp: <a href="{{ whatsappLink }}" target="_blank" rel="nofollow">
        {% contact with name='WhatsApp' %}
    </a>
</p>
{%- endif %}

Suggested placement of template file:The display code for these contact methods is usually placed in the public part of the website, such as:

  • bash.htmlorheader.html/footer.html:The header or footer of the website, ensuring that it displays on every page.
  • page/detail.html(or a custom single-page template):Create a dedicated 'Contact Us' page that showcases all contact information.

Practical cases and techniques: Build a complete footer contact information block.

Let's look at a practical code example of integrating multiple contact methods into a website footer, which allows visitors to easily find the information they need:

`html

<div class="container">
    <div class="contact-info">
        <h4>联系我们</h4>
        <p>联系人:{% contact with name='UserName' %}</p>
        <p>电话:<a href="tel:{% contact with name='Cellphone' %}" rel="nofollow">{% contact with name='Cellphone' %}</a></p>
        <p>邮箱:<a href="mailto:{% contact with name='Email' %}">{% contact with name='Email' %}</a></p>
        <p>地址:{% contact with name='Address' %}</p>

        {%- comment %} 显示微信信息及二维码 {%- endcomment %}
        {%

Related articles

How to manage website navigation links and display them on the front page in AnQiCMS?

When building and managing a website, a clear and intuitive navigation system is the foundation of user experience and search engine optimization.AnQiCMS provides a flexible and powerful navigation management mechanism, allowing you to easily organize the website structure and elegantly present it to users. ### One, Back-end Navigation Management: Build the Skeleton of Your Website The navigation management feature of AnQiCMS is located in the "Back-end Settings" menu. Click on "Navigation Settings" to enter.Here, you can build a clear navigation system for the website like stacking blocks.

2025-11-07

How to display the language switch options and hreflang tags on a multilingual site in AnQiCMS?

Building multilingual websites in AnQiCMS and providing convenient language switch options as well as correct hreflang tags is a key step in expanding the international market and improving user experience.AnQiCMS with its flexible architecture provides a clear path to achieve this goal, allowing your website content to accurately reach global users while ensuring search engine friendliness. ### Overview of AnQiCMS Multilingual Implementation AnQiCMS integrates multilingual support with multi-site management functions in its design.This means, each different language version

2025-11-07

How to get and display detailed information of user groups in AnQiCMS template?

In AnQiCMS, user group management is one of the core functions for building differentiated services and content monetization systems.It is crucial to display detailed information about user groups accurately in the front-end template, whether it is to provide exclusive content for VIP users or to set access restrictions for users of different permission levels.This not only improves the user experience, but also effectively guides users to understand and upgrade their own permissions.How can we flexibly obtain and display the detailed information of these user groups in the AnQiCMS template?

2025-11-07

How to parse and output HTML code in AnQiCMS template instead of escaping it?

When using AnQi CMS for website content creation and template design, we often encounter a problem related to HTML code display: Why is the HTML code I enter in the background editor displayed as plain text on the front page instead of being parsed by the browser as actual HTML elements?This is actually the content management system that defaults to enabling HTML content escaping for website security.This article will delve into how to effectively control the output of HTML code in the AnQiCMS template, ensuring that it is parsed correctly and not displayed as escaped.

2025-11-07

How to loop and display the titles (ContentTitles) of AnQi CMS documentation in the front-end template?

Dynamically display document content title: The Loop and Application of ContentTitles in AnQiCMS front-end template When operating website content with AnQiCMS, we often need to provide users with a better reading experience and navigation convenience. One very practical feature is to automatically generate the article table of contents (Table of Contents).AnQiCMS considers this very carefully, it can automatically extract the titles from the document content and provide them to the front-end template in the form of `ContentTitles`. Today

2025-11-07

How AnQiCMS supports custom content models to implement

During the process of building and operating a website, we often encounter such challenges: the standard article or product templates provided by the content management system (CMS) often cannot fully match the unique needs of our business.AnQiCMS (AnQiCMS) is aware of this pain point and therefore designed 'flexible content model' as one of its core highlights from the beginning, aiming to help users break free from the束缚 of traditional CMS and achieve personalized content management in the true sense.

2025-11-07

How does AnQiCMS achieve diverse content structure display through the content model?

In today's rapidly changing digital world, the richness and diversity of website content are key to attracting and retaining users.AnQiCMS provides a powerful function in content management, namely **content model**, which allows the website to easily build and display various structured content, meeting users' needs for content presentation.What is the content model of AnQiCMS?One of the core strengths of AnQiCMS is its flexible content model design.In simple terms, the content model is the 'blueprint' or 'skeleton' of your website's content

2025-11-07

How to configure AnQiCMS to achieve seamless switching and display of multilingual content?

Today, with the deepening of globalization, website support for multiple languages is no longer an optional choice, but a key factor for enterprises to expand into international markets and serve diverse user groups.It is crucial to have the ability to seamlessly switch and display multilingual content, whether it is to attract overseas customers or enhance the brand's international influence.AnQiCMS is fully aware of this need, providing an efficient and practical solution for seamless switching and display of multilingual content through its powerful multi-site management features and flexible template mechanism.Here, we will discuss how to configure AnQiCMS

2025-11-07