How to display the website's contact phone number and address on the AnQiCMS front-end page?

Calendar 👁️ 75

In website operation, clearly and conveniently displaying the website's contact phone number and address is a crucial step in building user trust and promoting communication and exchange.For friends using AnQiCMS, the system provides a very flexible and intuitive way to manage and display this important contact information.This article will introduce in detail how to display the contact phone number and address of the website on the AnQiCMS front-end page.

Step 1: Enter the contact information in the AnQiCMS backend

Firstly, we need to ensure that the contact information of the website is correctly entered in the background. This is the basis for displaying this information on the front end.

Please log in to the AnQiCMS admin interface, find it in the left navigation bar,Backend settingsthen click to enter theContact information settingspage.

On this page, you will see a series of preset fields, such as "contact",Contact phone numberHello WorldContact addressContact email, WeChat ID, and WeChat QR code etc.This is the most commonly used contact information on the website, you just need to fill in your actual website or company information in the corresponding input box.

If your website has special requirements, such as displaying WhatsApp contact information in addition to the regular phone number, or other custom contact information, the "Contact Settings" page of AnQiCMS also supports adding custom parameters. You can add custom parameters at the bottom of the page.Custom settings parametersIn the area, click to add a new parameter. For example, you can add a parameter named "WhatsApp" and enter your WhatsApp number in the parameter value.The system will automatically convert parameter names to camel case when calling templates (i.e., each word is capitalized, such asWhatsApp)

After completing the information entry, remember to click the 'Save' button at the bottom of the page to ensure all changes take effect.

Step 2: Display contact information in the frontend template file.

When the background data is ready, the next step is to display this information on the website's frontend page. AnQiCMS's template system uses syntax similar to Django, with a powerful tag specifically for retrieving contact information——contact.

ThiscontactThe way to use the label is very direct, by specifyingnamethe parameter, you can obtain the corresponding field value you entered in the background "Contact Information Settings".

Display contact phone number

To display the contact phone number on the website page, you can use the following code in the template file:

{% contact with name='Cellphone' %}

This code will directly output the value you entered in the "contact phone" field in the background.To enhance the user experience, especially for mobile users, we usually make the phone number clickable and dialable.You can implement it like this:

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

Herehref="tel:..."Is a standard HTML attribute that allows mobile device users to directly click to make a phone call,rel="nofollow"It is recommended that search engines not track this link, which is usually a practice of SEO.

Display contact address

It is also simple to display the contact address. You just need to use it in the template.name='Address'Just set the parameters:

地址:{% contact with name='Address' %}

Invoke custom parameters

If you have set custom parameters in the background, such as the ones mentioned earlier,WhatsAppyou can also use them.contactLabel to call. To handle it more strictly, you can first assign it to a variable and check if it exists before deciding whether to display it:

{# 假设您在后台自定义了参数名为 'WhatsApp' #}
{% contact whatsappNumber with name='WhatsApp' %}
{% if whatsappNumber %}
<p>WhatsApp:{{ whatsappNumber }}</p>
{% endif %}

In this way, only whenWhatsAppWhen there is a value in the background, the front-end page will display the corresponding content.

Where should it be placed in the template?

You usually place this contact information in the public part of the website, for example:

  • HeaderInbash.html(If your template has this file, it usually contains the common header of the website) or other header template files, allowing visitors to quickly find contact information on any page.
  • FooterAt the bottom of the website, this is the most common practice. It is also added inbash.htmlor a dedicated footer template file.
  • the "Contact Us" pageIf you create a dedicated "Contact Us" page (created under "Page Resources" > "Page Management"), you can use the content template on that page (for example,page/detail.htmlor customizedpage/contact-us.htmlIn this section, detail all contact methods.

A complete example code snippet may look like this, you can adjust it according to your template structure:

{# 假设这是你网站页脚或侧边栏的一部分 #}
<div class="site-footer-contact">
    <h3>联系我们</h3>
    <p>电话:<a href="tel:{% contact with name='Cellphone' %}" rel="nofollow">{% contact with name='Cellphone' %}</a></p>
    <p>邮箱:<a href="mailto:{% contact with name='Email' %}" rel="nofollow">{% contact with name='Email' %}</a></p>
    <p>地址:{% contact with name='Address' %}</p>
    {% contact wechat with name='Wechat' %}
    {% if wechat %}
    <p>微信:{{ wechat }}</p>
    {% endif %}
    {% contact whatsappNumber with name='WhatsApp' %}
    {% if whatsappNumber %}
    <p>WhatsApp:{{ whatsappNumber }}</p>
    {% endif %}
</div>

Tip

  • Template file encodingEnsure that your template file uses UTF-8 encoding, otherwise it may cause the page to display garbled characters.
  • Style adjustmentThe above code is responsible for outputting content, and the specific appearance style (font, color, layout, etc.) needs to be adjusted through CSS to maintain consistency with the overall design style of your website.
  • Multi-site managementIf you have used the multi-site feature of AnQiCMS and want to call the contact information of a specific site (instead of the current site),contactTags also supportsiteIdparameter to specify the site ID, for example{% contact with name='Cellphone' siteId='2' %}.

Easily display the website's contact number and address through AnQiCMS's flexible backend settings and powerful template tags.Hope this article can help you better utilize AnQiCMS and improve the user experience and business conversion of your website.


Frequently Asked Questions (FAQ)

1. Why did I set the contact information in the background, but it did not display on the front-end page?

There are usually several reasons:

  • The template file did not add the corresponding call codePlease check the template file (such as the footer or contact us page) you want to display contact information, whether it has been used in the way described in this article{% contact ... %}tags to call.
  • The background settings have not been saved: Did you click the 'Save' button after filling out the information on the 'Contact Information Settings' page.
  • Cache issueIn some cases, the browser or AnQiCMS system cache may cause updates to not be displayed in time.Try clearing the browser cache or click the "Update Cache" feature in the AnQiCMS backend.

2. I want to display different contact numbers on different pages, can AnQiCMS do that?

Related articles

How to display custom copyright information in AnQiCMS templates?

In AnQiCMS website operation, the website footer usually carries important information, among which the copyright statement is not only a legal requirement, but also an embodiment of brand professionalism.Clear and dynamically updated copyright information that can enhance the professional image of the website and provide basic protection for the content.In AnQiCMS, managing and displaying custom copyright information on the website is a very intuitive and flexible operation.Next, we will learn how to set and display your custom copyright information in the AnQiCMS template.--- ### One

2025-11-08

How to obtain and display the filing number of the AnQiCMS website?

For websites operating in mainland China, the filing number (ICP number) is an indispensable element.It is not only a requirement of laws and regulations, but also an important symbol to enhance the credibility of the website and gain the trust of users.AnQiCMS knows this point and therefore considered convenient management and display of the filing number at the very beginning of system design, allowing website operators to easily complete the configuration. Next, we will together learn how to obtain (configure) and display the filing number on the AnQiCMS website.

2025-11-08

How to display website name and Logo in AnQiCMS?

The website's name and logo are like the face of a brand, they are not only the first impression visitors have of you, but also an important manifestation of the website's professionalism and recognition.In AnQi CMS, setting and displaying your website name and logo is a straightforward and efficient process.Next, we will explore how to perfectly present these key elements on your website. ### First, set up the website name and Logo To make your website have a unique name and Logo, the first step is to configure it in the Anqi CMS backend management interface.1. **Enter Global Settings**

2025-11-08

How to control the automatic lazy loading of images in the article content of AnQi CMS

In website operation, page loading speed and user experience are crucial aspects.Especially for articles that contain a large number of images, the loading of images often becomes the 'culprit' that slows down the page speed.At this time, the image lazy loading (Lazy Loading) technology is particularly critical.AnQi CMS deeply understands this, providing a simple and efficient way to control the automatic lazy loading of images in article content, helping your website to improve performance and user experience.Why is lazy loading of images so important? Lazy loading of images is a strategy of deferred loading

2025-11-08

How to dynamically display the website's homepage TDK information in AnQiCMS?

The TDK of a website, which stands for Title (title), Description (description), and Keywords (keywords), is a basic element of Search Engine Optimization (SEO), which directly affects the display effect and user click intention of the website in the Search Engine Results Page (SERP).For the "face" of the website - the homepage, accurate and attractive TDK information is crucial.In AnQiCMS (AnQiCMS), managing and dynamically displaying the TDK information of the website homepage is a straightforward and efficient task

2025-11-08

How to build and display a multi-level navigation menu in AnQiCMS template?

The website navigation is the first window for users to interact with the website. A clear and intuitive navigation system can greatly enhance the user experience and help visitors quickly find the information they need.AnQiCMS provides a flexible and powerful navigation management function, whether it is a simple single-level menu or a complex two-level, three-level, or even more hierarchical multi-level navigation, it can be easily realized.Next, we will learn in detail how to build and display multi-level navigation menus in AnQiCMS.## Backend Settings: The Foundation of Navigation Construction Navigation construction in AnQiCMS begins with careful configuration in the backend

2025-11-08

How to use the breadcrumb navigation tag of AnQiCMS to display the current page path?

In website operation, a clear navigation path is crucial for user experience and search engine optimization (SEO).A Breadcrumb Navigation is an auxiliary tool that can significantly improve the usability of a website, providing a quick and convenient way for users to return to their previous page and clearly indicating their position on the current page.In AnQiCMS, implementing breadcrumb navigation is very simple and flexible.AnQiCMS provides us with a dedicated breadcrumb navigation tag `breadcrumb`, through it

2025-11-08

How to get the category list of a specified content model and display it in AnQiCMS?

In AnQiCMS, flexibly obtaining and displaying the category list of the specified content model is the key to building a clear website structure and a good user experience.Whether it is product display, article archive, or service introduction, the category list plays an important navigation role.AnQiCMS's powerful template tag system makes this process intuitive and efficient.

2025-11-08