As an experienced website operations expert, I have a deep understanding of the powerful functions of AnQiCMS in actual operation, especially the exquisite design in multi-site management. Today, let's delve into a seemingly minor but crucial parameter in the multi-site management of AnQiCMS -siteIdWhat role does it play, and how can we make full use of it to optimize content operation strategies.


AnQiCMS multi-site managementsiteIdThe core function and practice of parameters

AnQiCMS, as an enterprise-level content management system developed based on the Go language, one of its core strengths is its efficient and flexible multi-site management capabilities.It allows users to easily create, manage, and operate multiple independent websites through a unified backend.Whether it is a company with multiple brand sub-sites or an operation team that needs to publish content for different niche markets or regions, AnQiCMS's multi-site feature provides great convenience.How to ensure the data independence of each site under this 'one-stop' management model, and how to achieve data sharing and intercommunication when necessary?siteIdThis parameter is among.

Unveiling multi-site management:siteIdThe background of its birth

Under such an architecture, in order to distinguish and manage these logically independent sites, AnQiCMS introducessiteIdThis parameter is the [site ID].siteIdIt is the unique identifier for each logical site.Its main responsibility is to ensure that the system can accurately identify and locate specific sites during data operations or content calls, thereby achieving data isolation and precise invocation.

siteIdThe core function: data isolation and cross-site invocation

In daily operations, when you call content in a page or template of a site, AnQiCMS will intelligently identify the current site'ssiteIdand defaults to returning data only from this site.This means that all articles, products, pages, and other content published on site A will be displayed on the front end of site A by default, and will not 'stray' into site B or site C.siteIdThe implicit filtering ensures the natural independence of content across sites.

However,siteIdIts value is far more than this. When you need to break through these site boundaries and call data from one site to another, siteIdIt is crucial to the parameters. The strength of AnQiCMS lies in its exposure of almost all template tags and potential API interfaces.siteIdParameters grant operators great flexibility, allowing them to 'pull' content from other sites at any given location.

For example, if you are on site A,siteId="1"Operate a corporate brand site, as well as at site BsiteId="2"Operate a blog site.Now, you wish to display the latest 5 articles of the blog site on the homepage of the corporate brand station.

{% archiveList latestBlogs with siteId="2" limit="5" %}
    {% for item in latestBlogs %}
        <p><a href="{{item.Link}}">{{item.Title}}</a></p>
    {% endfor %}
{% endarchiveList %}

Here,siteId="2"Explicitly inform AnQiCMS to retrieve the latest article list from the site with ID 2 (i.e., the blog site). If there is not onesiteIdParameter, the system will default to fetching articles from the current site (Site A).

Not only the article list, but almost all template tags related to content, such asarchiveDetail(Document Details),categoryList(category list),pageList(Single-page list),contact(Contact Information),systemeven (System Information) andlinkList(Friend Links), etc., are supportedsiteIdThis means that as long as you know the target site'ssiteId[en] It can achieve cross-site calls for any type of data, thus building a more complex and interconnected ecosystem of websites.

[en] Actual application scenarios and operational value

siteIdThe existence of parameters brings multiple values to content operation:

  1. Achieve content linkage and mutual promotion:You can display the latest activities, popular products of sub-sites on the main site, or associate relevant blog articles with product detail pages, effectively promoting internal traffic circulation and user conversion.
  2. Build a centralized data source:Some common data, such as corporate contact information, brand logo, terms of service, etc., can be stored in a 'reference site', and other sites can access it by specification.siteIdCall to unify, ensure data consistency, and reduce the workload of repeated maintenance.
  3. Simplify internationalization or multi-regional site management:For sites in different countries or regions, although the content may be independent, some common modules or data (such as company profiles, FAQs, etc.) can be shared, throughsiteIdTo distinguish and call, greatly enhance operational efficiency.
  4. Flexible content aggregation and distribution:You can even create a 'Content Center' site that aggregates the best content from all sub-sites,siteIdrealizing the secondary distribution and aggregation display of content.

siteIdThe difference from multi-instance deployment

It is worth noting that,siteIdParameters are used to manage and distinguish multiple logical sites within an AnQiCMS application instance. This is in contrast to deploying multiple independent AnQiCMS application instances on the same server (each running on a different port and having independentconfig.jsonThe concept of and Go process) is different.

  • Multiple instance deployment:Each AnQiCMS instance is a completely independent application, owning its own configuration file, process, and possibly independent database connections. There is no built-insiteIdInterconnected, if data intercommunication is needed, it is usually achieved through API interfaces or other external integration methods.
  • Multi-site management (usingsiteId):All logic sites run under the same AnQiCMS application instance, sharing the same core code and runtime environment.siteIdThis is an AnQiCMS internal mechanism used to distinguish the data and configuration of these logical sites.

It is crucial to understand this distinction, as it can help you choose the most suitable deployment and management strategy based on your actual needs. If you require high physical isolation or a completely independent technology stack, you might opt for multiple instances; however, if you pursue unified management, resource sharing, and efficient operation, AnQiCMS's built-in multi-site management andsiteIdThe flexible application will be the better solution.


By processingsiteIdA deep analysis of the parameter shows that it is not only the foundation of multi-site management for AnQiCMS, but also a powerful tool for content operation experts to implement refined and efficient content strategies. Mastery is required.siteIdThe application, will let you on the stage of AnQiCMS