How to display all AnQiCMS contact information uniformly at the footer of the website without repeating code?

Calendar 👁️ 73

Good, as an experienced website operation expert, I am very willing to explain to you in detail how to implement unified management and display of website footer contact information in AnQiCMS, ensuring the efficiency of content maintenance and the conciseness of code.


Say goodbye to repetitive labor: Efficiently manage website footer contact information in AnQiCMS

In website operation, the footer usually contains important information such as the company's contact information, copyright statement, friend links, filing number, etc.This information is not only an important way for users to obtain the basic situation of the site, but also a key component of Search Engine Optimization (SEO).However, many websites often face a difficult problem during the construction process: how to maintain consistency of the footer information on all pages, while avoiding code repetition and ensuring convenience for future modifications?

AnQiCMS as an efficient and customizable enterprise-level content management system perfectly solves this pain point.It separates content configuration from template rendering strategies, complements with a powerful template tag system, allowing you to easily achieve centralized management and dynamic display of footer information, thereby saying goodbye to繁琐 repetitive code and significantly improving website maintenance efficiency.

Why is it so important to manage footer information uniformly?

Imagine if your website has hundreds of pages, and the footer contact information is hardcoded on each page.Once the phone number changes, you will need to modify these hundreds of files one by one, which is undoubtedly a nightmare of physical labor.Unified management of footer information, its importance is reflected in the following aspects:

  1. Improve maintenance efficiency:All footer information needs to be configured and modified in one place, and it can be synchronized updated throughout the site.
  2. Ensure information consistency:Avoid missing or incorrect information due to manual modification, resulting in different pages displaying different versions of the information.
  3. Optimizing user experience: Users can find accurate and up-to-date contact information on any page, enhancing the professionalism and credibility of the website.
  4. Beneficial for Search Engine Optimization (SEO):Stable, high-quality footer information (such as copyright, filing, main contact information) helps search engines better understand and index your website.

How AnQiCMS helps manage footer information?

The subtlety of AnQiCMS lies in itsContent and presentation separationThe design concept. It stores the configuration information of the website in the background database and throughTemplate TagsThe mechanism is called as needed in the front-end template. CombinedPublic code snippets (Partials/Includes)With the application of this, unified footer management can be easily achieved.

In particular, AnQiCMS mainly provides several key functions to support this goal:

  • Backend centralized configuration:Provide a dedicated interface for configuring the global information of the website (such as website name, filing number) and contact information.
  • Flexible template tags: Allow developers to directly read the various configuration items of the background through concise tag syntax in the template file.
  • Template inheritance and inclusion mechanism:Support to extract common parts like the footer into independent template files and reference them on pages where the footer needs to be displayed.

We will demonstrate how to build a dynamic and maintainable website footer in AnQiCMS through specific steps.

Practice: Build a dynamic and maintainable website footer

To implement the unified display of website footer information without repeating code, it is mainly divided into three core steps:Configure information centrally in the background,Create a common footer template file, as well asInclude the file in the main template.

Step 1: Preparation: Centralize your website configuration information

Firstly, make sure that all your website's basic information and contact details have been entered in the AnQiCMS backend. This is the foundation for dynamic data display.

  1. Global website settings:

    • Log in to the AnQiCMS backend and navigate to后台设置-u003e全局设置.
    • Here, you can find and fill in网站名称/网站LOGO/备案号码/版权信息Global website information. This information often appears in the footer.
    • Tip:If you have any other general text that needs to be displayed in the footer but is not a contact method (such as company mission, Slogan, etc.), you can add it through the "custom settings parameter". For example, you can add one namedCompanyMissionThe parameter, and fill in your company's mission in the parameter value.
  2. Contact information settings:

    • Navigate to后台设置-u003e联系方式设置.
    • Here are standardized contact information fields such as联系人/联系电话/联系地址/联系邮箱/微信号/微信二维码/QQetc. Please fill in according to your actual situation.
    • Flexible expansion:If you need to display other social media links (such as WhatsApp, Facebook, Twitter, Instagram, etc.), you can also use the 'Custom Settings Parameters' at the bottom of the page to add them. For example, you can add aWhatsAppLinkEnter the parameter and fill in your WhatsApp contact link. This will greatly enhance the footer's customization capabilities without modifying any code.
  3. Friendship link management:

    • Navigate to功能管理-u003e友情链接.
    • Add the links you want to display in the footer here. AnQiCMS will manage them uniformly and provide tags for the frontend to call.

Completed these backend configurations, all the data required for your footer is ready and can be used in the frontend at any time.

Step two: Create a common footer template file (partial/footer.html)

The template design of AnQiCMS follows the principle of convention over configuration. At the root directory of the template/template, there is usually a theme folder for you (for exampledefault), you can create one in this topic folderpartialdirectory (if it doesn't exist), and create a new one namedfooter.htmlThe file. This file will carry all the common code and dynamic information of the footer.

Open.partial/footer.htmlYou can use the template tags provided by AnQiCMS to dynamically obtain and display the information configured in the background.

`html

<div class="container">
    <div class="footer-contact-info">
        <h3>联系我们</h3>
        <ul>
            {%- comment -%} 从联系方式设置中获取联系人信息 {%- endcomment -%}
            {%- if contact with name="UserName" -%}
            <li>联系人:<span>{% contact with name="UserName" %}</span></li>
            {%- endif -%}

            {%- comment -%} 从联系方式设置中获取联系电话 {%- endcomment -%}
            {%- if contact with name="Cellphone" -%}
            <li>电话:<a href="tel:{% contact with name="Cellphone" %}" rel="nofollow">{% contact with name="Cellphone" %}</a></li>
            {%- endif -%}

            {%- comment -%} 从联系方式设置中获取联系邮箱 {%- endcomment -%}
            {%- if contact with name="Email" -%}
            <li>邮箱:<a href="mailto:{% contact with name="Email" %}" rel="nofollow">{% contact with name="Email" %}</a></li>
            {%- endif -%}

            {%- comment -%} 从联系方式设置中获取联系地址 {%- endcomment -%}
            {%- if contact with name="Address" -%}
            <li>地址:<span>{% contact with name="Address" %}</span></li>
            {%- endif -%}

            {%- comment -%} 从联系方式设置中获取微信号(假设后台自定义了一个WhatsAppLink) {%- endcomment -%}
            {%- if contact with name="Wechat" -%}
            <li>微信:<span>{% contact with name="Wechat" %}</span></li>
            {%- endif -%}
            {%- if contact with name="WhatsAppLink" -%}
            <li>WhatsApp:<a href="{% contact with name="WhatsAppLink" %}" target="_blank" rel="nofollow">联系我们</a></li>
            {%- endif -%}
        </ul>
        {%- comment -%} 也可以直接获取二维码图片 {%- endcomment -%}
        {%- if contact with name="Qrcode" -%}
        <div class="qrcode">
            <img src="{% contact with name="Qrcode" %}" alt="微信二维码">
            <p>扫码咨询</p>
        </div>
        {%- endif -%}
    </div>

    <div class="footer-links">
        <h3>友情链接</h3>
        <ul>
            {%- comment -%} 从友情

Related articles

What default social media contact method tags does AnQiCMS support?

As an experienced website operations expert, I am well aware that seamless integration between websites and social media is crucial in today's digital marketing environment.A high-efficiency content management system (CMS) should not only provide content publishing capabilities, but also simplify users' interactions with social platforms.AnQiCMS (AnQiCMS) performs well in this aspect, providing great convenience to website operators through built-in contact label tags.Today, let's delve into which social media contact methods AnQiCMS supports by default, and how to cleverly use them to enhance the user connection efficiency of the website

2025-11-06

How to insert WeChat QR code picture into the website through AnQiCMS contact method tags?

As an experienced website operations expert, I fully understand the importance of efficient communication between websites and users.In today's digital age, WeChat, as an important social tool, its QR code has become an indispensable part of enterprises attracting attention, providing services, and accumulating users.For operators using AnQiCMS (AnQi Content Management System), how to cleverly embed WeChat QR code images on the website, maintaining the professional image of the website while making it convenient for users to scan and follow, is the key to improving user experience and conversion rates.AnQiCMS with its efficient based on Go language

2025-11-06

How to correctly display the WeChat number of the website in the AnQiCMS template?

As an experienced website operations expert, I fully understand the importance of social media channels, especially WeChat, in connecting enterprises with users, providing services, and even promoting sales in the digital age.AnQiCMS (AnQiCMS) is a content management system tailored for operators, naturally taking full consideration of these common operational needs.Today, let's delve deeply into how to display your website's WeChat number in the AnQiCMS template in the most correct and elegant way.

2025-11-06

How can website operators display the contact email configured in AnQiCMS on the front page?

As an experienced website operations expert, I am well aware of the importance of a website's contact information, especially the contact email, in building user trust, promoting communication, and improving conversion rates.In AnQiCMS (AnQi content management system), displaying these key information efficiently and accurately on the front page is a highlight in the daily work of website operators.Today, let's delve into how to cleverly utilize the powerful functions of AnQiCMS to make your contact email shine on the front page.

2025-11-06

Does the AnQiCMS contact information tag support displaying multiple custom social media accounts at the same time?

As an experienced website operation expert, I know that in an increasingly diversified digital age, whether a website can effectively connect with its audience largely depends on the breadth and convenience of its contact information.AnQiCMS (AnQiCMS) has always been committed to providing flexible and efficient solutions in content management, then, is the contact information label of AnQiCMS supported to display multiple custom social media accounts simultaneously?This specific question, my answer is: **Fully supported and very flexible

2025-11-06

How to call the custom contact information field added in the AnQiCMS template?

The complete guide to calling the custom contact information field in AnQi CMS template: from backend configuration to frontend display As an experienced website operations expert, I know the importance of a flexible and efficient content management system for a corporate website.AnQiCMS stands out among many CMSs with its powerful custom capabilities and SEO-friendliness.It can not only help us easily manage content, but also seamlessly integrate various information configured in the background with the front end of the website through its flexible template mechanism.Today, let's delve into a very practical scenario

2025-11-06

How to add a new custom contact field in the AnQiCMS contact information settings?

## Contact Information Setting for AnQi CMS: Easily add custom fields to meet your unique needs In the operation of a website, an efficient and personalized way of displaying contact information is often the key to establishing trust and promoting conversions between enterprises and users.AnQi CMS knows this, its powerful customizability allows you to easily go beyond default settings, add exclusive contact fields to your website, and ensure that your site perfectly fits the unique needs of your business.AnQi CMS is an efficient and customizable enterprise-level content management system that provides rich content models and SEO tools

2025-11-06

What are the naming conventions or suggestions when defining a custom contact method field?

In the powerful function ecosystem of Anqi CMS, the flexibility of custom contact information fields is undoubtedly a key factor in improving website operation efficiency.As an experienced website operations expert, I know that every detail can affect the overall performance of the website, and the naming conventions of 'parameter names', although seemingly trivial, are actually related to the maintainability, scalability, and smoothness of team collaboration of the website content.

2025-11-06