How to call and display the contact information (phone, email, address) set in the back-end template on the front-end?

Calendar 👁️ 75

In website operation, clearly and effectively displaying contact information is crucial for establishing user trust and promoting communication and exchange.Whether it is to consult products, seek service support, or provide feedback, a readily accessible phone, email, or address can greatly enhance the user experience.AnQiCMS (AnQiCMS) has fully considered this need, providing a flexible and convenient way, allowing website administrators to centrally manage contact information in the background, and easily call and display it on the front-end page through simple template tags.

Step 1: Set your contact information in the backend

To display the contact information in the front-end template, you first need to make a unified setting in the Anqi CMS backend.This ensures that all contact information is centrally managed, making it convenient for subsequent modifications and maintenance.

After entering the Anqi CMS backend management interface, you will find a special module for managing contact information. Here, the system has preset multiple commonly used contact information fields, such as:

  • Contact Name: Used to identify your contact person or department, such as "Manager Zhang", "Sales Department".
  • Contact phone number: The phone number that customers can directly dial.
  • Contact address: Your company or store's specific location for easy customer visits.
  • Contact email: Customers can contact you through email.
  • WeChat ID and WeChat QR code: Convenient for mobile users to add friends or scan and follow.
  • In addition, it supports mainstream social media contact methods such as QQ, WhatsApp, Facebook, Twitter, Tiktok, Pinterest, Linkedin, Instagram, and Youtube.

If these preset fields do not meet your personalized needs, AnQi CMS also providesCustom settings parametersfunction. You can create any contact information fields you need based on your business characteristics.For example, if you need to display a special customer service hotline or a specific online consultation link, you can customize a parameter name of "CustomerServiceHotline" or "OnlineChatLink" and enter the corresponding value.When setting custom parameters, you need to specify a "parameter name" (usually recommended to use English or pinyin, which will be automatically converted to camel case for template calling), and assign a "parameter value" to it, and you can also add "notes" for future management.

By centralized settings on the backend, you can ensure the consistency and accuracy of all relevant contact information on the website, avoiding the麻烦 of manual modifications on multiple pages, greatly improving operational efficiency.

Step 2: Call and display contact information in the front-end template

After you have completed the contact information setup in the background, you can easily call this data in the website's front-end template next. Anqi CMS provides a concise and powerful template tag for this——contact.

contactThe basic usage of tags is:{% contact 变量名称 with name="字段名称" %}In which, the variable name is optional, if you specify a variable name, you can store the contact information obtained in a variable for multiple uses in the template;If the variable name is omitted, the label will directly output the field value.The core lies innameThe parameter corresponds to the name of the contact information field you set in the background.

For example, to call and display the most commonContact phone numberYou can write the code like this:

<p>联系电话:{% contact with name="Cellphone" %}</p>

This line of code will directly display the phone number you entered in the background "Contact Settings". To make it convenient for users to click and dial directly, you can wrap it in HTML's<a>Labels, and usetel:protocol:

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

Similarly, callContact emailIt is also very simple:

<p>电子邮件:{% contact with name="Email" %}</p>

If you want users to be able to send email by clicking on a link, you can handle it like this:

`twig

<a href="mailto:{% contact with name='Email'

Related articles

Does AnQiCMS support directly retrieving and displaying system configuration information (such as website name, Logo) in templates?

During the process of building and maintaining a website, we often encounter the need to display basic information about the website at various positions on the page, such as the name of the website, Logo, copyright statement, filing number, and so on.If this information is scattered in all corners of the template, it will be very cumbersome and prone to errors once it needs to be modified.What kind of solution does AnQiCMS provide in this regard?Does it support us to directly obtain and display these system-level configuration information in the template?The answer is affirmative.

2025-11-07

How to implement the multi-language content switching and front-end display of AnQiCMS website?

It is undoubtedly a crucial link in the construction of a global digital content platform.AnQiCMS (AnQiCMS) is a management system designed specifically for content operators, deeply understanding this field, providing comprehensive multi-language content switching and front-end display functions, aiming to help users efficiently expand into the international market and reach a wider audience.## AnQiCMS Multilingual Function Overview AnQiCMS is developed based on Go language, and it is an ideal choice for small and medium-sized enterprises and content operation teams due to its high efficiency, customizability, and scalability.

2025-11-07

How to control the number of articles displayed per page and the sorting method on the article list page?

## Fine Control: The Practical Guide to the Number and Sorting of Articles on the AnQi CMS List Page In content operations, the list page of articles on the website is an important window for users to browse content and discover information.A well-organized and content-rich list page, which not only enhances user experience but is also a key factor in search engine optimization (SEO).AnQi CMS is well-versed in this, enabling you to easily and precisely control the number of articles displayed per page and the sorting method of the content through its powerful and flexible template tag system.This article will take you deep into how to use Anqi CMS

2025-11-07

How to customize the URL rewrite rules for the article detail page in the AnQiCMS template?

## Optimize SEO, Enhance User Experience: AnQiCMS Detailed Explanation of Custom Article Detail Page URL Static Rules In website operation, a clear and meaningful URL structure is crucial for search engine optimization (SEO) and user experience.Imagine a user sees `/article.php?Which link would be more attractive to them, the one with `id=123&category=news` such as this, or the one with `/news/anqicms-url-guide.html` such as this?

2025-11-07

How does AnQiCMS ensure the safety and compliance of front-end displayed content, such as sensitive word filtering?

When operating a website, the security and compliance of content is an indispensable part, especially in the context of the increasingly regulated online environment today.For users who use AnQiCMS, the system provides a variety of functions to help ensure the security and compliance of the displayed content on the front end, such as the sensitive word filtering that users are generally concerned about.At the beginning of its design, AnQiCMS placed content security at the core position.It is not just a content publishing tool, but also a platform dedicated to providing users with a safe and compliant content management environment

2025-11-07

How to implement lazy loading (Lazyload) of images in the article content to optimize page performance?

In website operation, page loading speed is crucial for user experience and search engine optimization (SEO).Especially when the article content includes a large number of images, the loading of image files often becomes the "culprit" that slows down the page speed.Lucky enough, by implementing the Lazyload image technology, we can effectively solve this problem.For friends using AnQiCMS, understanding and applying this technology will significantly improve website performance. Image lazy loading, as the name implies, is to delay the loading of images outside the user's current viewport.When the user scrolls the page

2025-11-07

How to implement the dynamic display of multi-level navigation menus in front-end templates?

In web design, a clear and easy-to-use navigation menu is the key to improving user experience and the professionalism of the website.AnQiCMS (AnQiCMS) provides the convenience of dynamically building multi-level navigation menus in front-end templates with its flexible template engine and powerful content management features.Understand the backend configuration and the calling logic of the front-end template of its navigation system, which is the foundation for achieving this goal. ### Overview of Anqi CMS Navigation System The navigation feature of Anqi CMS is designed to be very practical, closely integrating the creation of navigation menus with content display. On the backend

2025-11-07

How to correctly display the list of related articles on the content detail page in AnQiCMS?

On AnQiCMS content detail page, displaying related article lists can effectively guide visitors to browse more content, reduce the bounce rate, and enhance the website's SEO performance through internal link structure.AnQiCMS is a system designed specifically for content operations, providing flexible and powerful template tags, allowing us to easily achieve this function.How does AnQiCMS recognize and display related articles?To make the content detail page intelligently display a list related to the current article, AnQiCMS provides a straightforward mechanism

2025-11-07