How to dynamically retrieve and display the contact information of the website in AnQiCMS?

Calendar 👁️ 65

In today's digital age, a website's contact information is not just cold numbers or addresses; it is a bridge for building trust and communication between users and businesses.Efficiently and accurately displaying this information on the website, and being able to update flexibly as needed, is crucial for any website operator.AnQiCMS as an enterprise-level content management system provides a very intuitive and powerful solution in this regard, allowing you to easily manage these key information without touching complex code.

This article will introduce in detail how to configure and dynamically obtain the contact information of the website in AnQiCMS, ensuring that your website always displays the latest and most accurate contact information.

Back-end configuration: the source of contact information

All dynamic contact methods on the website are concentrated in the AnQiCMS backend settings. This is the 'central brain' where you can manage and update your contact information.

First, log in to the AnQiCMS backend management interface. In the left navigation bar, you will see a menu item named “Backend settings”. Click to enter and continue to select “Contact information settings.

After entering the "Contact Information Settings" page, you will find that the system has pre-set many commonly used contact information fields, such as:

  • Contactis usually the contact name you want to display to others.
  • Contact phone number:For customer consultation phone number.
  • Contact address:The specific location of your company or service point.
  • Contact email:Customers can contact you via email.
  • WeChat ID:For adding WeChat friends.
  • WeChat QR code: Upload the QR code image directly for easy scanning by users.
  • In addition, it also supportsQQ/WhatsApp/Facebook/Twitter/TikTok/Pinterest/LinkedIn/Instagram/YouTubelinks or account information for mainstream social media platforms.

You just need to fill in your latest information in the corresponding input box, and the system will save it properly.

The strength of AnQiCMS lies in its high customizability. If you have specific contact information for your business that is not included in the above list, or if you need some special display content, you can go through theCustom settings parametersAdd functionality to be flexible.

For example, you may need to display a dedicated customer service phone number for a company in a specific region, which is different from the general contact number. You can click to add and set a distinctive “Parameter Namefor exampleAreaServicePhonethen fill in specificParameter valuefor instance010-88889999and add aNoteTo explain its purpose. This "parameter name" will be the key identifier you use to call this information in the website front-end template.In this way, AnQiCMS ensures that the system can adapt to various personalized business needs.

front-end display: flexibly call through template tags

After configuring all contact information in the background, the next step is how to dynamically present this information on the front page of your website.AnQiCMS uses a template engine syntax similar to Django, through specific tags, you can bind background data to any position on the page in a very intuitive and convenient manner.

The core isContact Information TagIt is used in the basic format of{% contact 变量名称 with name="字段名称" %}.

  • nameParameter: This is the contact information you filled in the background “Contact Settings”field name(such asCellphone,EmailorCustom parameter name(such as the one you addedWhatsApp)

Let's look at some specific examples to see how we can flexibly call this information in the template:

  1. Display contact phone number:The footer or contact us page of a website usually displays a contact phone number. You can insert it into the template file:

    <p>联系电话:{% contact with name="Cellphone" %}</p>
    
  2. Display contact email:To facilitate user email contact, you can call the email address like this:

    <p>联系邮箱:<a href="mailto:{% contact with name="Email" %}">{% contact with name="Email" %}</a></p>
    
  3. Display WeChat QR code:For contact methods of image type, such as WeChat QR code, you need to refer to it asimglabel'ssrcan attribute value. Make sure you have uploaded the QR code image on the backend.

    <img src="{% contact with name="Qrcode" %}" alt="微信二维码" />
    
  4. Display the custom WhatsApp link:If you added a custom in the backgroundWhatsAppcontact information, and its "parameter name" is exactlyWhatsAppThen you can call it in the template like this:

    <p>WhatsApp:<a href="https://wa.me/{% contact with name="WhatsApp" %}" target="_blank">点击联系</a></p>
    

    This has been usedhttps://wa.me/Prefix, assume your WhatsApp parameter value is a phone number, so you can generate a clickable WhatsApp chat link.

These{% contact ... %}The tag can be flexibly placed in any template file of the website, whether it is the header, footer, sidebar, or an independent 'Contact Us' page.This design ensures that your contact information remains highly consistent, and after a single update in the background, the entire site can be synchronized, greatly enhancing operational efficiency, and ensuring the accuracy and timeliness of the information.

Through the intuitive backend settings and powerful template tag system provided by AnQiCMS, dynamic management and display of the website's contact information have become simpler than ever before.It not only reduces the trouble and risk of manually modifying code, but also gives you complete control over the display of website content, making your website operation more efficient and flexible.


Frequently Asked Questions (FAQ)

1. I added a new contact method (such as a Telegram link) in the background 'Contact Settings', but it didn't show on the website frontend. What could be the reason?

This is usually because you haven't added the corresponding tag in the website template file to call it. The 'Contact Information Settings' on the back end only stores information, and you still need to add it in the template (such as the footer templatepartial/footer.htmlor contact us pagepage/contact.htmlUse it in{% contact with name="您自定义的参数名" %}such as this.

Related articles

How to display the document list under a specific Tag in AnQiCMS?

In AnQiCMS, tags (Tag) are a powerful and flexible way to organize content, allowing you to associate documents in multiple dimensions without relying on traditional hierarchical classification structures.When you want to display all documents under a specific topic or keyword, it is particularly important to show the document list under a specific tag.This not only helps visitors find the content they are interested in faster, but also effectively improves the internal link structure and SEO performance of the website.

2025-11-08

How to retrieve and display the friend link list in AnQiCMS template?

In website operation, friendship links are an important factor in improving website authority, increasing external traffic, and optimizing user experience.AnQiCMS (AnQiCMS) is well aware of this, and therefore provides a convenient friend link management function in system design, and supports flexible calling and display in templates.This article will provide a detailed introduction on how to retrieve and display the friend link list in your AnQiCMS template.### Management of friendship links: Starting from the background Before starting the template call, make sure that your website's background has configured the friendship links

2025-11-08

How to display the Tag list associated with the article in AnQiCMS?

In AnQiCMS, effectively managing and displaying the tag (Tag) list of articles can not only help with content organization but also significantly improve the internal link structure and search engine optimization (SEO) effect of the website.Labels as a flexible classification method can link articles across categories and themes, providing users with a richer browsing path. ### Manage and create article tags in the background First, understanding how to add and manage article tags in the AnQiCMS background is fundamental.

2025-11-08

How to call and display the form fields submitted by users in the AnQiCMS template?

AnQi CMS provides a flexible mechanism to handle the interactive content of websites, among which the message form is an important bridge for communication with users.When we need to collect diverse information from users, we often create custom message fields.How to accurately call and display these custom form fields configured in the backend template on the website's frontend, which is the key to achieving personalized user experience.In AnQiCMS, the display of the message form fields mainly depends on the use of template tags.

2025-11-08

How to use the `if` tag for conditional judgment to control content display in AnQiCMS templates?

How to use the `if` tag for conditional judgment to control content display in AnQiCMS templates?When building website templates, we often need to display or hide specific content blocks based on different conditions.For example, the image will be displayed only when the article has a thumbnail, or the welcome message will be displayed only after the user logs in.In the AnQiCMS template system, the `if` tag is a powerful tool for implementing conditional judgments.It uses a syntax similar to the Django template engine, concise and expressive, making the content display logic clear and easy to understand

2025-11-08

How to use a `for` loop to iterate over data and display content in AnQiCMS templates?

In AnQiCMS template development, we often need to display a series of dynamic content, such as the latest article list, product categories, navigation menu items, and even custom parameters.At this point, the 'for loop' has become the core tool for us to traverse these data and display it on the web page.Understand and master the `for` loop, which will greatly enhance the flexibility and development efficiency of the template.### Core Grammar: The Foundation of Data Traversal The `for` loop syntax in AnQiCMS templates is concise and intuitive, borrowing the style of the Django template engine.

2025-11-08

How to format a timestamp (timestamp) into a readable date format for display in AnQiCMS?

In the process of website operation, the effective display time of content publishing or updating is crucial for improving user experience and the readability of content.If time information is presented in the original timestamp format, it is often difficult for ordinary users to understand.AnQiCMS provides a straightforward and flexible way to help you convert these digital timestamps into easily readable date and time formats.### How AnQiCMS handles timestamps AnQiCMS typically uses standard Unix Timestamp format for storing content time information

2025-11-08

How to truncate a string and add an ellipsis (...) to limit the display length in AnQiCMS template?

In AnQiCMS template development, we often need to refine the content displayed on the website, such as article titles, summaries, or abstracts of a text.If the content is too long, it not only affects the beauty of the page, but may also reduce the user's reading experience.AnQiCMS's powerful template engine provides a simple and efficient method to solve this problem, allowing us to easily extract strings and automatically add ellipses (...) to elegantly limit the display length of content.

2025-11-08