How to obtain and display the contact information, phone number, email, WeChat, and other contact methods set in the background?

Calendar 👁️ 68

Hello, as an experienced security CMS operator, I know that clear and convenient contact information on the website is crucial for user experience and business conversion.Today, let's discuss in detail how to configure contact information in the Anqi CMS backend and display it flexibly and accurately on various positions of the website front-end.

Configure website contact information: Back-end operation guide

In AnQi CMS, managing the website's contact information is an intuitive and powerful process. First, we need to enter the backend management interface for configuration.

To access the contact information settings, please log in to the Anqi CMS backend, find the "Backend Settings" menu through the left navigation bar, and then click the "Contact Information Settings" submenu.Here, you will see a series of default contact information settings, including contacts, phone numbers, contact addresses, contact email, WeChat ID, and WeChat QR code.These fields are designed to meet the basic needs of most corporate websites.

You just need to fill in your contact information in the corresponding input box.For example, enter your contact name in the "Contact" field, and enter your business phone number in the "Phone number" field.If your WeChat QR code is ready, you can directly click the upload button to upload the picture.

It is worth mentioning that AnQi CMS also provides high flexibility, allowing you to add custom contact information according to the specific needs of your website.In the "Custom Settings Parameters" area, you can click the "Add" button to create a new contact information field, such as "WhatsApp Contact Information", "Skype Account", or "Backup Email" and so on.You need to set a "parameter name" for each custom parameter as the identifier for template calls (it is recommended to use English), and fill in the corresponding "parameter value".Finally, you can add a "note" to facilitate future management and understanding of the parameter's purpose.After completing all information entry and adjustments, be sure to click the save button to ensure changes take effect.

Display contact information on the website front-end: template call practice

Once the contact information is configured in the background, the next step is to correctly reference and display this information in the website template. Anqi CMS provides a special "Contact Information Tag" for this purpose. ...contact), so that template developers can easily access this data.

Call the default contact method field

contactThe use of tags is very concise, you can use{% contact 变量名称 with name="字段名称" %}The form of the variable name to obtain a specific field value. If the variable name is omitted, the label will output the field content directly.

Here are some examples of commonly used contact information fields, you can place them in the header, footer, "Contact Us" page, or any location where you need to display contact information:

To display the contact name, you can use:

<span>联系人:{% contact with name="UserName" %}</span>

If you need to display the contact phone number, you can write it like this:

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

Here we have added extra:tel:The protocol facilitates direct dialing by mobile device users and has been used.rel="nofollow"Property.

Display contact email:

<span>联系邮箱:<a href="mailto:{% contact with name="Email" %}">{% contact with name="Email" %}</a></span>

Similarly,mailto:The protocol allows users to send emails directly by clicking.

Show WeChat ID:

<span>微信号:{% contact with name="Wechat" %}</span>

For WeChat QR code images and similar resources, you need to refer to them as images of thesrcattribute, and pay attention to usingsafea filter to ensure the correct output of HTML code:

<span>微信二维码:<img src="{% contact with name="Qrcode" %}" alt="微信二维码" /></span>

In this way, the WeChat QR code image uploaded on the backend can be displayed normally on the front end.

Invoke custom contact information field

If you have customized a new contact information field in the background, such as the previously mentioned "WhatsApp contact information", its "parameter name" isWhatsAppThen the way to call it in the template is similar to the default field, justnameThe parameter value with your custom parameter name:

<span>WhatsApp联系方式:{% contact with name="WhatsApp" %}</span>

Call the contact method in a multi-site environment

For an AQ CMS system deployed on multiple sites, if you want to call the contact information of another site in a template on a specific site, you can usesiteIdSpecify the site ID with parameters. For example, the contact phone number of a site with ID 2:

<span>其他站点电话:{% contact with name="Cellphone" siteId="2" %}</span>

However, in most cases, you will display the contact information of the current site in the template of the current site, and there is no need to specifysiteIdParameter.

Content Optimization and Practical Suggestions

When displaying contact information, it is equally important to ensure that the content is presented correctly.

First, make sure your contact information is up-to-date and accurate.Contact information that is expired or incorrect can confuse and frustrate users, severely affecting user experience.Regularly check this information, especially after business adjustments or personnel changes.

Secondly, place the contact information in a location where users can easily find it.The website's header and footer are common preferences as they are visible on every page.At the same time, creating an independent "Contact Us" page, providing a more detailed contact form, map, and all contact channels will further enhance the trust and convenience of users.

Finally, considering the needs of different user groups, provide as much diversity of contact methods as possible.For example, in addition to phone and email, WeChat, WhatsApp, online customer service, and other services can meet the different usage habits of users.Make sure these links are clickable and can guide users to the correct communication channels.

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?

This is usually due to incorrect usage of the template.contactThe tag is being called, or the template cache is not updated in time. Please check if your template file contains the corresponding{% contact ... %}tag and make surenameThe parameter matches the field name set in the background (including custom fields).If the label is used correctly, please try to clear the security CMS system cache to ensure that the latest data can be loaded.

2. Can I make different pages display different contact information?

contactThe label retrieves the universal contact information settings, which cannot be changed dynamically according to the page.If you need to display unique contact information on a specific page, consider inserting text or images directly in the page content editor, or create an independent contact page using the "single page" feature and embed the required information in the content.Another advanced method is to use custom fields, add additional contact information fields in the backend content model for specific pages, and call them in the page templates.

3. How can I add click-to-dial/send email functionality to a phone number or email?

You can use HTML in the template.tel:andmailto:To implement the protocol. For example, for phone:<a href="tel:{% contact with name="Cellphone" %}" rel="nofollow">{% contact with name="Cellphone" %}</a>. For email:<a href="mailto:{% contact with name="Email" %}">{% contact with name="Email" %}</a>. These protocols allow users to make phone calls or launch email clients directly by clicking on links on supported devices.

Related articles

How to call and display the name, Logo, and other system global configuration information in AnQi CMS template?

As an experienced security CMS website operations personnel, I am well aware of the importance of the global configuration information of the website, such as the website name and logo, for the unified display of the brand image and user recognition.In AnQi CMS, these core information is unifiedly managed, and through a concise and efficient template tag mechanism, it allows operators to easily call and display on various pages of the website. ### Management of website global configuration information in AnQi CMS AnQi CMS centralizes the global configuration information of the website in the "Global Function Settings" module of the background.

2025-11-06

How to implement template customization for specific categories or pages, for example `page/about.html`?

As an experienced CMS website operator, I am well aware of the importance of content presentation for user experience and Search Engine Optimization (SEO).AnQiCMS provides a powerful and flexible template customization mechanism, allowing us to create exclusive visual and functional layouts based on different content types or specific page requirements.Today, I will detail how to implement template customization for specific categories or pages in AnQiCMS, such as the needs we often encounter, such as `page/about.html`.

2025-11-06

What are the differences between the 'Folder mode' and 'Flat mode' in the template file organization pattern?

As a senior security CMS website operations personnel, I am well aware of the importance of template file organization methods for website post-maintenance, content release efficiency, and team collaboration.In AnQi CMS, the organization mode of template files is mainly divided into two types: 'folder mode' and 'flattened mode', each with its own characteristics and suitable for different project needs and team habits.Understanding the differences between these two patterns can help us better choose and manage templates.First, let's delve deeper into the **folder organization pattern**.

2025-11-06

How can I customize the templates for 404, 500 error pages, and site shutdown notification pages?

As a senior security CMS website operator, I fully understand the importance of every user touch point, including those unusual pages, in carrying the brand image and user experience.A meticulously customized 404, 500 error pages, and site shutdown notification pages, which not only enhance the professionalism of the website but also provide guidance to users when they encounter problems, effectively reduce the bounce rate, and maintain a good search engine impression. Next, we will discuss in detail how to customize these special pages in Anqi CMS.

2025-11-06

How to dynamically set and call the SEO title, keywords, and description (TDK) of the current page in the template?

As an experienced CMS website operation personnel in a cybersecurity company, I am well aware that high-quality content and excellent search engine optimization (SEO) are the foundation of a website's success.Among them, the SEO title (Title), keywords (Keywords), and description (Description) of the page, abbreviated as TDK, play a vital role.They are not only the key for search engines to understand the content of a page, but also an important factor in attracting users to click.In Anqi CMS, we have flexible and powerful mechanisms to dynamically set and call these TDK information

2025-11-06

How to display a website navigation menu and support multi-level dropdown navigation?

As an experienced CMS website operation personnel of an enterprise, I know that a well-organized and easy-to-use navigation menu is crucial for the website user experience and content discovery.AnQi CMS provides a powerful and flexible navigation management function, which can help us easily set up the main menu of the website and also support multi-level dropdown navigation to meet the needs of complex website structures. ### Backend Navigation Configuration: Build Menu Structure The setting of the navigation menu in AnQi CMS starts from the backend management interface.

2025-11-06

How to correctly generate and display breadcrumb navigation on a page?

As an experienced CMS website operation person in an enterprise, I am very clear about the importance of breadcrumb navigation in improving user experience and website SEO.It not only helps visitors clearly understand their position on the website, but also guides search engines to better understand the website's hierarchical structure.In AnQi CMS, correctly generating and displaying breadcrumb navigation is a fundamental and important content management task.

2025-11-06

How to get the classification list under a specific content model (such as articles, products)?

As an experienced CMS website operation personnel for Anqi, I know the importance of content organization and user experience for the success of the website.Accurately display content categories, not only can help users quickly find the information they are interested in, but also improve the overall SEO performance of the website.Today, we will delve into how to obtain the category list under specific content models (such as articles, products) in AnQiCMS, which is crucial for building clear website navigation, content aggregation modules, and special pages.

2025-11-06