Cross-site language data seamless call: AnQiCMS multi-site environment content operation tool
As an expert well-versed in website operations, I am fully aware of the challenges faced in managing content in a multi-site, multi-language environment.The繁琐的重复工作、data synchronization issues often make the operator feel inadequate.However, AnQiCMS, with its powerful multi-site management and multilingual support capabilities, provides us with a graceful and efficient solution.Today, let's delve into how to cleverly call language data from other sites in the multi-site environment of AnQiCMS to achieve efficient content reuse and collaboration.
AnQiCMS was designed from the beginning to fully consider the needs of enterprises and content operation teams for multi-site management.It not only allows you to create and independently manage multiple sites, but more importantly, it provides a powerful mechanism for cross-site data sharing and resource integration.With its built-in multilingual support, this means you can easily handle content display needs for different brands, regions, and even languages in a unified backend.
Core strategy:siteIdThe magic of parameters
In the AnQiCMS template tag system, the key to calling language data from other sites lies in a seemingly simple yet powerful parameter: siteId
When you configure multiple sites in the AnQiCMS background, each site will be assigned a uniquesiteId. By passing this target site'ssiteIdYou can accurately pull the specific data under the site, whether it is system configuration, contact information, or specific articles, product information.
1. Call system-level and contact information
Imagine you have a main brand website and multiple sub-sites for different regions or languages.On the footer of the sub-site or the "About Us" page, you may want to display the unified contact information of the main brand or the company registration information.siteIdit can be put to use.
For example, you can call the main station's website name, Logo, filing number, as well as contact phone number and email:
{# 假设主站的siteId是1 #}
<p>
本网站由 {% system with name="SiteName" siteId="1" %} 运营。<br>
备案号:<a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">{% system with name="SiteIcp" siteId="1" %}</a> <br>
联系电话:{% contact with name="Cellphone" siteId="1" %}
</p>
By specifyingsiteId="1"Even if the current page belongs to another site, it will accurately retrievesiteIdthese systems and contact information from site 1 to ensure brand consistency.
2. Cross-site reference content details and list
Furthermore,siteIdDemonstrating its true power in the calling of content details and lists. Assuming your English sitesiteId=2There is an extremely important product introduction on it, you hope to be on the Chinese site(siteId=3On a specific page, refer to the title, description, or even part of this introduction without repeating it on the Chinese site.
- Get the details of a specific article or product:
{# 假设英文站(siteId=2)有一篇ID为100的产品文章 #}
{% archiveDetail englishProduct with name="Title" id="100" siteId="2" %}
<h3>我们的英文站点推荐:{{ englishProduct }}</h3>
{% archiveDetail englishProductDesc with name="Description" id="100" siteId="2" %}
<p>摘要:{{ englishProductDesc }}</p>
here,siteId="2"Ensure that the article title and description with ID 100 are obtained from the English site rather than the current Chinese site.
- Display the list of popular articles from other sites:You can even display the latest or most popular articles from other sites in the sidebar or homepage of the current site.
{# 显示英文站(siteId=2)最新的5篇文章 #}
<h3>英文站最新动态:</h3>
<ul>
{% archiveList englishPosts with type="list" limit="5" siteId="2" %}
{% for item in englishPosts %}
<li><a href="{{ item.Link }}">{{ item.Title }}</a></li>
{% endfor %}
{% endarchiveList %}
</ul>
This not only enriches the content of the current site, but also provides a cross-site browsing entry for users, improving the overall user experience. Similarly,categoryList/pageList/tagListtags also supportsiteIdParameters, allowing you to flexibly call the category, single-page, or tag data of other sites.
3. Unified navigation and breadcrumb path
For brands with complex site structures, a unified navigation menu and clear breadcrumb path are crucial.navListandbreadcrumbTags also support.siteIdShare menu structure or build a coherent navigation path across different sites.
{# 调用主站(siteId=1)的顶部导航 #}
<nav>
{% navList mainNav with typeId="1" siteId="1" %}
<ul>
{% for item in mainNav %}
<li><a href="{{ item.Link }}">{{ item.Title }}</a></li>
{% endfor %}
</ul>
{% endnavList %}
</nav>
This is very helpful in maintaining the unity of brand image and smooth transition of users between different sites.
Invoke the self-information of the multilingual site:languagesTag
Except throughsiteIdPrecisely calling specific data from other sites, AnQiCMS also provides a multi-language environment specifically designedlanguagesLabel.This tag is not used to pull the content itself, but to obtain an overview of all language sites in the current multi-site environment, such as their language names, language codes, and corresponding links.