AnQiCMS under the multi-site management mode provides great flexibility for content operators. When you need to display unique contact information in a common template according to different sub-sites, the contact label of AnQiCMS and itssiteIdThe parameter can fully show its strength.As an experienced website operation expert, I deeply understand the importance of this fine management for improving user experience and operational efficiency.Today, let's delve into how to flexibly call the contact information data of a specified sub-site in the AnQiCMS multi-site mode.


AnQiCMS multi-site management: personalized display under a unified architecture

One of the core strengths of AnQiCMS is its powerful multi-site management function.It allows you to create and independently manage multiple brand websites, product sub-sites, or regional sites under the same system architecture.This pattern greatly reduces repetitive work and improves resource integration efficiency.Although the underlying system is shared with AnQiCMS, each sub-site has an independent database, template configuration, and content data, including crucial contact information.

siteIdThe parameter is designed to solve this pain point.

Contact information tag: default call to the specified site data

AnQiCMS provides convenientcontactThe label used to call the data configured in the background "Contact Settings" in the template.By default, when you use this tag directly in the template, it will intelligently retrieve the contact information of the current visited site.

{# 默认调用当前站点的联系电话 #}
联系电话:{% contact with name="Cellphone" %}
{# 默认调用当前站点的联系邮箱 #}
联系邮箱:{% contact with name="Email" %}

When visiting Subsite A, the template will display the contact phone number and email configured for Subsite A in the background.If you visit sub-site B, the data of sub-site B will be displayed.This is very convenient for displaying the current site information.

However, when the requirements upgrade, it needs to be explicitly specified in a template to call the data from *another* sub-site.siteIdThe parameters come into play.siteIdAllow you to precisely tell the system which specific child site's contact information you want to obtain.

Reveal the core features: usingsiteIdCall data from the specified child site

The key to calling data from a specific sub-site in multi-site mode is to use it correctlycontactlabel'ssiteIdparameter.Each child site created in the AnQiCMS backend "Multi-Site Management" is assigned a unique numeric ID by the system.You can find this ID by viewing the "Multi-site Management" list, or by looking at the URL in the browser address bar when editing a sub-site.

Assuming you have the following two sub-sites:

  • Main site (ID: 1):Used mainly for brand display, contact phone number is400-123-4567.
  • Branch A site (ID: 2):Used for specific area services, contact phone number is010-88889999.

Now, you want to display the contact information of Branch A in addition to the main station's contact information on a specific page of the main site. You can do this in the template:

  1. Contact the main site of the current station:

    {# 调用当前主站(SiteId为1)的联系电话 #}
    主站客服电话:{% contact with name="Cellphone" siteId="1" %}
    

    Or more succinctly, since it is the current site, it can also be omittedsiteId:

    主站客服电话:{% contact with name="Cellphone" %}
    
  2. Contact the contact information of Branch A site:

    {# 调用分公司A(SiteId为2)的联系电话 #}
    分公司A电话:{% contact with name="Cellphone" siteId="2" %}
    

In this way, even if you are in the template environment of the main site, you can clearly obtain and display the contact information of Branch A.

If you need to store the data obtained into a variable for subsequent complex logic judgment or formatted output, you can operate as follows:

{# 获取主站点的联系人,并赋值给变量mainSiteContact #}
{% contact mainSiteContact with name="UserName" siteId="1" %}
主站联系人:{{ mainSiteContact }}

{# 获取分公司A站点的邮箱,并赋值给变量branchAEmail #}
{% contact branchAEmail with name="Email" siteId="2" %}
分公司A邮箱:{{ branchAEmail }}

You can easily integrate contact information from different sub-sites into a template without having to create a separate template file for each site, which greatly improves the template reuse rate and the flexibility of content management.

actual application scenarios and operation thinking

This feature has a wide range of application value in actual operation:

  • Unified footer management:You can design a universal footer template that includes the main site's copyright information, and dynamically displays the exclusive contact address for the visitor's sub-site, or lists the key contact information of all subsidiaries uniformly across all sites.
  • Personalized landing page:Quickly create multiple sub-site landing pages for different marketing activities or regions, they share the same core template but only need to go throughsiteIdThe parameter can accurately display the unique contact information of the event or region, improving the conversion rate.
  • Multilingual site:If your multi-site is to support users of different languages, throughsiteIdContact information for the corresponding language site can ensure that users receive localized support.
  • Operation efficiency optimization:When contact information needs to be updated, you can modify it in one place (i.e., the backend configuration of the corresponding sub-site), and all calls to thesiteIdThe templates will automatically update, avoiding the cumbersome manual replacement work.

AnQiCMS with this meticulous functional design truly achieves the goal of letting technology serve operations, making the complex multi-site management simple and efficient.


Summary

Under the multi-site management mode of AnQiCMS,contactLabel combinationsiteIdThe parameter provides powerful and flexible data calling capabilities for website content operators.It is easy to display personalized content under a unified template or to integrate cross-site information.Mastering this skill will help you manage and maintain your multi-site network more efficiently, providing users with more accurate and friendly access experiences.


Frequently Asked Questions (FAQ)

Q1: How do I know the parameters of my child sites?siteIdare?

A1:In the left navigation bar of the AnQiCMS backend management interface, click "Multi-site Management" and you will see a list of all created child sites.Each child site will usually display a unique numeric ID next to it.idThisidis what you need to usesiteId.

Q2: If not specified in the templatesiteIdthe contact information tag will call data from which site?

A2:By default, if the current page of the template does not specify explicitlysiteIdThe contact information label will automatically call the contact information data of the current visited site. For example, when the user visits sub-site A, it is not specified.siteIdofcontactThe label will display the contact information of Subsite A; when the user accesses Subsite B, Subsite B's data will be displayed.This ensures the correctness of data display when in single-site mode or when not cross-site calling.

Q3: Can I call the contact information of multiple child sites at the same time in a template?

A3:Of course you can. You just need to call it each time.contactwhen using tags, bysiteIdSpecify different sub-site IDs. For example, you can display the main site's switchboard phone number and the customer service phone number of a specific branch on the footer of a single page by calling twicecontactLabel, and pass in the correspondingsiteId.