How to display custom contact information on the website frontend, such as WhatsApp or Facebook links?

Calendar 👁️ 71

In today's digital age, making it easy for customers to find and contact you is the cornerstone of any successful website.Whether it is to provide customer support, promote sales, or build community interaction, a clear and visible contact method is crucial.Fortunately, Anqi CMS provides a set of intuitive and powerful features that allow you to easily display various custom contact methods on the website front end, such as WhatsApp or Facebook links, ensuring that your customers can always communicate with you conveniently.

Next, we will step by step introduce how to achieve this goal in Anqi CMS.


Step one: Back-end configuration - the 'home base' of contact information.

Firstly, we need to enter the Anqi CMS backend management interface, find the "Backend Settings" menu in the left navigation bar, and click to enter the "Contact Information Settings" option.This is the core area where you manage all the contact information for your website.

Here, you will see a series of preset contact information fields, such as contact person, phone number, address, email, WeChat ID, and WeChat QR code, etc.Even better, Anqi CMS has built-in direct support for some mainstream social platforms, such as WhatsApp, Facebook, Twitter, Tiktok, Pinterest, Linkedin, Instagram, Youtube, and so on.You just need to fill in your WhatsApp link in the corresponding field (for examplehttps://wa.me/您的WhatsApp号码)or Facebook page URL is fine.

If your needs are more specific, or if you want to add a contact method that is not on the default list, such as a special online customer service link, or if you want to display a social media link with a different name, the "Custom Settings Parameters" feature can come in handy. You just need to click "Add Custom Parameter", enter an easily recognizable "Parameter Name" (such asMyCustomChat) and the corresponding "parameter value" (which is the actual link or text), plus a "note" for easy memory, save it.This "parameter name" is the key to calling this information in the website template later.

After completing the information entry, click save, your contact information has already been safely stored in the system.


Step 2: Front-end display - make the information accessible

After setting up the contact information, the next step is to display them in a suitable position on the website front page.The Anqi CMS adopts a syntax similar to the Django template engine, allowing you to easily display this information to visitors with concise template tags.

The core of displaying contact information is to usecontacttags. This tag allows you to call the corresponding value according to the "parameter name" set in the background.

1. Show built-in WhatsApp or Facebook link

Assuming you have already filled in the complete link addresses for the "Contact Information Settings" fields such as "WhatsApp" and "Facebook" in the backend. Now, if you want to display these links in the footer or sidebar of the website, you can write the template code like this:

{# 在后台的“WhatsApp”字段填写:https://wa.me/1234567890 #}
{# 在后台的“Facebook”字段填写:https://www.facebook.com/yourpage #}

<div>
    <a href="{% contact with name='WhatsApp' %}" target="_blank" rel="noopener noreferrer">
        <img src="/public/static/images/whatsapp-icon.png" alt="WhatsApp">
        <span>通过WhatsApp联系我们</span>
    </a>
</div>

<div>
    <a href="{% contact with name='Facebook' %}" target="_blank" rel="noopener noreferrer">
        <img src="/public/static/images/facebook-icon.png" alt="Facebook">
        <span>访问我们的Facebook主页</span>
    </a>
</div>

Please note,imgin the labelsrcThe path needs to be adjusted according to the actual location where the icons are stored.target="_blank" rel="noopener noreferrer"It is a good practice in web development to open links in a new window and enhance security.

2. Display custom contact information

If you previously created a name in the backgroundOnlineChatLinkCustom parameters, and you have filled in your online customer service link, you can call it like this:

{# 假设您在后台自定义参数中设置了:参数名=OnlineChatLink,参数值=https://chat.example.com/ #}

<div>
    <a href="{% contact with name='OnlineChatLink' %}" target="_blank" rel="noopener noreferrer">
        <img src="/public/static/images/chat-icon.png" alt="在线客服">
        <span>在线咨询</span>
    </a>
</div>

3. The location to place the template code

These code snippets can be placed in multiple key positions on the website. The most common ones are in the global page header (usually corresponding toheader.htmltemplate file) or the footer (usually corresponding tofooter.htmlIn the template file, ensure that each page can be displayed.

For an independent page like 'Contact Us', you can edit the single page content in the background under 'Page Resources' -> 'Page Management', and directly insert these links in the visual editor. Or, if you want to finely control the display layout, you can do so in the template file corresponding to the single page (for example,page/detail.htmlMake edits within the parenthesis.

To keep the template structure clear and easy to maintain, you can encapsulate these code snippets for contact information./templatein a custom template file under the directory, for example, create onepartial/contact-info.htmla file, and then through{% include "partial/contact-info.html" %}the method in the place where it is needed.


Summary

By using the intuitive backend settings and flexible template tags of AnQi CMS, displaying custom contact information becomes extremely simple. Whether you want to add popular social media links or need to customize contact entries for specific requirements, An

Related articles

How to set up scheduled article publishing in AnQiCMS to achieve automated content display?

In today's internet age where content is king, the continuous update and efficient operation of website content is the key to attracting and retaining users.However, manual timed release is not only time-consuming and labor-intensive, but may also miss the**release opportunity due to negligence.AnQiCMS addresses this pain point by building a convenient scheduled publishing function, which helps us easily achieve automated content display.Why choose scheduled publication to achieve content automation?Timely publishing is not only a tool to improve efficiency, but also an indispensable part of content operation strategy.The benefits it brings are obvious: *

2025-11-09

Does AnQiCMS provide a feature for dynamically displaying the current year tag?

In the daily operation of website content, we often encounter some elements that need to be dynamically updated, the most common of which is the year in the copyright statement.If you need to manually change the year at the bottom of the website every year, it not only takes time and effort, but is also prone to omissions.As a pursuit of efficient and intelligent content management system, can AnQiCMS provide us with a solution to automatically update the current year?The answer is affirmative. AnQiCMS fully considers these subtle needs in website operation and has built-in corresponding tag functions for its template engine.

2025-11-09

How to safely output the article content containing HTML tags in a template, preventing XSS attacks while maintaining the format?

In website content operation, we often need to publish articles containing images, links, paragraph styles, and other rich formats.AnQiCMS (AnQiCMS) is a powerful content management system with a flexible template engine that can help us easily display these contents.However, while enjoying the convenience, we must also pay attention to a core issue: how to safely output the article content with HTML tags in the template, while maintaining its original beautiful format and effectively preventing potential cross-site scripting (XSS) attacks

2025-11-09

How to display the AnQiCMS comment list on the front end and show the reply level and like count?

In website content operation, user comments are an important aspect for building community atmosphere, enhancing content interaction, and collecting user feedback.AnQiCMS (AnQiCMS) fully understands this and provides a powerful and flexible comment management feature, and through its powerful template engine, allows you to easily display comments on the front-end page, including reply levels and like counts and other detailed information.Next, we will together learn how to clearly present these comments on your website using the template tags and fields of Anqi CMS.### AnQiCMS

2025-11-09

How to implement pagination functionality in AnQiCMS

For any website that carries a large amount of content, how to efficiently and friendly display this content is undoubtedly one of the keys to successful operation.When there are a large number of articles, products, tag pages, and other content, it is obviously unrealistic to pile them all on one page. This not only slows down the loading speed but also makes it difficult for users to find the information they need.At this time, the pagination function is particularly important. In AnQiCMS, implementing pagination is quite intuitive and flexible.It cleverly combines the acquisition of content lists with the display of pagination navigation, making the organization and presentation of website content both beautiful and efficient.###

2025-11-09

How to safely escape URL parameters in AnQiCMS templates to avoid potential risks?

When building and operating a website, URL (Uniform Resource Locator) parameters play a crucial role, helping us to achieve dynamic content display, filtering, and navigation functions.However, improper handling of URL parameters may also become a major security vulnerability for websites.This article will deeply explore how to safely escape URL parameters in the AnQiCMS template to effectively avoid potential risks.### The security risks of URL parameters should not be overlooked URL parameters usually carry user input or data generated by the system, such as search keywords, category ID

2025-11-09

How to specifically apply the `urlencode` filter to URL parameters in AnQiCMS templates?

In AnQiCMS template development, building dynamic URLs is a common requirement.Whether it is linking to the search results page, filtering list, or passing specific parameters to the backend service, the correctness of the URL is crucial.This is when the `urlencode` filter becomes a key tool to ensure that URL parameters are valid and secure. ### The Importance of URL Encoding URL (Uniform Resource Locator) has a strict character specification.In a URL, some characters have special meanings, such as `/` for path separation, `?

2025-11-09

What are the differences in application scenarios between the `iriencode` filter and `urlencode` in AnQiCMS templates?

In AnQiCMS template development, URL encoding is a detail that should not be overlooked.It not only affects the validity of the link, but also is closely related to the website's search engine optimization (SEO) and user experience.AnQiCMS provides `iriencode` and `urlencode` two filters for URL encoding, although they have similar purposes, there are obvious differences in application scenarios and encoding strategies.Understanding these differences can help us control the URL structure more accurately when building websites, ensuring the robustness and friendliness of the links.

2025-11-09