How to call and display the contact information set in the background of the AnQiCMS website at the bottom, such as phone number, email?

Calendar 👁️ 82

Display contact information clearly at the bottom of the website, which is crucial for improving user experience and building trust.AnQiCMS as an efficient content management system, fully considers this point, and provides an intuitive and flexible way to manage and display this key information, such as phone numbers and email addresses.

One, AnQiCMS backend contact settings and management

On the AnQiCMS admin interface, you can easily find and configure the website's contact information.These settings are located under the "Background Settings" menu, select "Contact Information Settings" to enter the editing page.Here not only provides common contact information fields such as contact name, phone number, contact address and contact email, but also allows you to add custom contact methods according to your actual business needs.

For example, if you need to display the company's WhatsApp account or the link to the Facebook homepage, you can add it here as a custom parameter, enter the corresponding name and value.This flexibility ensures that both traditional and social media contact methods can be managed and maintained in the same place, greatly simplifying the process of updating information.

Two, Call contact information in the website template

AnQiCMS's template engine is designed to be simple and efficient, with a syntax structure similar to Django templates, making it very convenient to display backend-configured data on the website's front end. The key to displaying the contact information set in the backend at the bottom of the website (usually in the footer area) is to use the built-incontact.

contactthe basic usage of tags is{% contact 变量名称 with name="字段名称" %}. Among them,nameThe parameter is used to specify the specific contact information type you want to call.

We take the phone number and email address of the called website as an example. Suppose you want to display these two pieces of information in the footer, you can add the following code to the footer template file of your website (usuallypartial/footer.htmlOr the main template file that includes the footer content).

<div class="footer-contact">
    <p>联系电话:{% contact with name="Cellphone" %}</p>
    <p>电子邮件:{% contact with name="Email" %}</p>
</div>

If you want to store this information in template variables for further logic processing or style binding, you can also do this:

{% contact websitePhone with name="Cellphone" %}
{% contact websiteEmail with name="Email" %}

<div class="footer-contact">
    <p>联系电话:{{ websitePhone }}</p>
    <p>电子邮件:{{ websiteEmail }}</p>
</div>

In addition to the phone and email, you can also call other predefined fields set in the background, such asAddress(Contact address),Wechat(WeChat ID) orQrcode(WeChat QR code). If you have customized the contact information parameter in the background before, such as "WhatsApp", you can use it as well{% contact with name="WhatsApp" %}to call its value. Just make surenameThe value of the parameter should be consistent with the parameter name you set in the background.

Section 3: Practical Operations and Precautions

The specific steps to display the contact information at the bottom of the website are as follows:

  1. Set contact information in the background:Log in to the AnQiCMS backend, navigate to "Backend Settings" -> "Contact Information Settings", fill in or update your phone number, email, address information, and save the changes.If needed, add any custom contact information.
  2. Locate the footer template file:Enter the "Template Design" area, find the template folder currently used by your website. According to the template structure, the footer code of the website usually exists inpartial/footer.html/bash.html(If the footer is a general part) or in some main HTML file under the root directory of the theme folder. If you are not sure which file it is, you can checkbash.htmlwhether it passesincludeThe label includes other files.
  3. Insert the call code:In the footer template file found, paste the aforementioned:contactLabel code snippet at the location where you want to display contact information.
  4. Save and update the cache:Save the template file you have modified. Then go back to the AnQiCMS background, click the 'Update Cache' feature at the bottom of the left navigation bar to ensure that the latest template content can be loaded on the website front end.
  5. Front-end preview:Refresh your website's front page and check if the contact information at the bottom is displayed correctly.

Points to note:

  • Template file encoding:When editing HTML template files, please ensure that the file encoding is UTF-8 to avoid Chinese character garbled issues.
  • Field name accuracy:Invokecontacttags in the template,nameThe value must match the field name in the background "Contact Settings" (including the "Parameter Name" of custom fields), pay attention to the case.
  • Cache cleanup:After modifying the template file or backend settings, it is a good habit to clear the cache, which ensures that the latest changes take effect immediately.

By following these steps, you can easily display the contact information set in the background of the AnQiCMS website at the bottom, providing visitors with a convenient communication channel.


Frequently Asked Questions (FAQ)

  1. Why didn't the website front-end update immediately after I updated the phone number or email address in the background?Answer: After modifying the content or settings in the AnQiCMS background, the system will use caching to improve website access speed.You usually need to manually clear the cache to see the latest changes on the front end.You can find the "Update Cache" feature on the AnQiCMS backend (usually at the bottom of the left navigation bar), click to execute it.

  2. Besides phone and email, I can also usecontactLabel which contact information to call?Answer: BesidesCellphone(Phone) andEmail(Email), you can also callAddress(Contact address),Wechat(WeChat ID),Qrcode(WeChat QR code image URL) and preset fields. More flexible is that if you add custom parameters in the "Contact Information Settings" backend (for example, parameter name isWhatsAppYou can also use{% contact with name="WhatsApp" %}to call its corresponding value.

  3. Ask: How can I make the phone number in the call clickable or make the email clickable to send an email link?Answer: You can combine HTML's<a>Tags andtel:ormailto:protocol to implement. For example:

    {% contact phoneNum with name="Cellphone" %}
    {% contact emailAddr with name="Email" %}
    <p>电话: <a href="tel:{{ phoneNum }}">{{ phoneNum }}</a></p>
    <p>邮箱: <a href="mailto:{{ emailAddr }}">{{ emailAddr }}</a></p>
    

    In this way, when visitors click on a phone number or email, they can directly make a call or send an email.

Related articles

How to display the link to the previous and next article on the article detail page in AnQiCMS template?

In AnQiCMS, adding "Previous Article" and "Next Article" navigation links to the article detail page is a key factor in enhancing user experience and guiding users to delve deeper into the website content.The powerful template system of AnQiCMS makes this feature very intuitive and efficient, it uses syntax similar to Django template engine, making it easy for developers to master. AnQiCMS template files are usually suffixed with `.html` and stored in the `/template` directory.

2025-11-09

How to integrate MathJax or Mermaid.js in AnQiCMS page to display mathematical formulas and flowcharts?

Integrate MathJax and Mermaid.js on AnQiCMS page: Easily display mathematical formulas and flowcharts AnQiCMS is an efficient and flexible content management system that excels in meeting various content display requirements.With the increasing richness of technical content, many users may encounter the need to elegantly display mathematical formulas and flowcharts on websites.AnQiCMS integrates its built-in Markdown editor and flexible template support, allowing integration with MathJax and Mermaid.js

2025-11-09

How to implement nested display of multi-level category navigation with the `categoryList` tag in AnQiCMS?

When building a website with comprehensive functionality, a clear and easy-to-navigate category system is the key to improving user experience and optimizing content structure.AnQiCMS as an efficient enterprise-level content management system provides flexible template tags to meet diverse content display needs.Among them, the `categoryList` tag is the core tool for achieving nested display of multi-level classification navigation.

2025-11-09

How to get and display the extended fields of a custom content model in the AnQiCMS template?

Flexibly obtain and display extended fields of custom content models in the AnQiCMS template, which is the key to achieving personalized content display on the website.AnQiCMS powerful content model customization capabilities, allowing us to add various unique attributes to articles, products, and other content according to actual business needs, and how to present these customized data beautifully in the frontend template is exactly the topic we are going to delve into today.### The Flexibility of AnQiCMS Content Model AnQiCMS is an enterprise-level content management system developed based on the Go language

2025-11-09

How to implement dynamic display and link jump of the website homepage Banner carousel in AnQiCMS?

In website operation, an attractive homepage banner carousel is a key element to enhance user experience, highlight core content, and guide user behavior.AnQiCMS as an efficient and flexible content management system provides an intuitive way to manage and display these dynamic contents.Next, we will explore how to easily implement the dynamic display and link jump of the website homepage Banner slideshow using AnQiCMS.

2025-11-09

How to truncate article content in AnQiCMS template and display “...”?

How to elegantly truncate article content and display "..." in the AnQiCMS template?In website content operation, we often need to display the summary of articles, products, or single-page content on list pages, aggregation pages, or search results.These summaries not only make the page look neater, but also help visitors quickly understand the content outline, so that they can decide whether to click to read the full text.

2025-11-09

How does AnQiCMS ensure that each site's page content is displayed independently under multi-site management?

AnQiCMS was designed from the beginning to fully consider the needs of enterprises and content operators for multi-site management and is committed to providing a highly efficient and independent solution.When you create multiple sites in AnQiCMS, the system ensures that the page content of each site can be displayed independently, without interference, and also allows for limited cross-site content interaction when needed.

2025-11-09

How to display the category name and link of the article belonging to the AnQiCMS document detail page?

In AnQiCMS, we often hope that visitors can clearly see the category name of this article when browsing the document details, and can conveniently click on the category link to further explore more content under the same category.This not only optimizes the user experience and makes the website structure more intuitive, but also helps search engines better understand the content hierarchy of the website, improving SEO effects. To implement this feature on the document detail page of AnQiCMS, we need to make some simple modifications to the template file.AnQiCMS uses something similar to Django

2025-11-09