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 trivial 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 role and practice of parameters

AnQiCMS, as an enterprise-level content management system developed based on the Go language, one of its core advantages 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 function provides great convenience.How can we ensure the data independence of each site under this "one-stop" management mode, and how can we achieve data sharing and interoperability when necessary?The answer is hidden insiteIdThis parameter is in.

Unveiling multi-site management:siteIdBackground of birth

Imagine that you are managing a group company, which has multiple independent brands, each with its own official website, but all content editing and publishing are hoping to be completed on a single backend.The multi-site management of AnQiCMS is exactly for solving such a scenario.The system allows you to create multiple "logical sites" in the background, each of which can have its own domain name, template, content model, classification system, and even an independent database name (although the database account information can be reused when deploying in Docker, but the data tables are independent), but they all run under the same AnQiCMS application instance.

Under such an architecture, in order to distinguish and manage these logically independent sites, AnQiCMS introducessiteId(Site ID) this parameter.siteIdIs the unique identity 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 calls.

siteIdThe core function: data isolation and cross-site call

In daily operation, when you call content on a page or template of a site, AnQiCMS will intelligently identify the current site'ssiteIdAnd by default, it only returns the data of the site. This means that all the articles, products, pages, and other content published by site A will only appear on the front end of site A, and will not mistakenly appear on site B or site C.This is based onsiteIdThe implicit filtering ensures the natural independence of content across sites.

However,siteIdIts value is far more than this. When you need to break through the boundaries of sites and call data from one site to another,siteIdParameters are crucial. The strength of AnQiCMS lies in the fact that it exposes in almost all template tags and potential API interfaces.siteIdParameters grant operators great flexibility, allowing them to "pull" content from other sites on any site.

For example, if you are on site A,siteId="1")Operate a corporate brand site, and at site B(siteId="2") Run a blog site. Now, you want to display the latest 5 articles of the blog site on the homepage of the corporate brand site.At this time, you can use the following label calling method on the home template of site A:

{% 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"Tell AnQiCMS explicitly to retrieve the latest article list from the site with ID 2 (i.e., the blog site). If there is not thissiteIdParameters, the system will default to retrieving articles from the current site (Site A).

Not only the article list, almost all template tags related to content, such asarchiveDetail(Document Details),categoryList(Category list),pageList(Single-page list),contact(Contact information),system(System information) even tolinkList(Friend links) and others are supportedsiteIdThis means that as long as you know the target site's parameters.siteIdIt can realize cross-site calls for any type of data, thus building a more complex and interconnected website ecosystem.

Practical application scenarios and operational value

siteIdThe existence of parameters brings multiple values to content operation:

  1. Implement content linkage and mutual promotion:You can display the latest activities and hot products of the sub-sites on the main site, or associate relevant blog articles with product detail pages to effectively promote internal traffic circulation and user conversion.
  2. Build a centralized data source:Certain general data, such as company contact information, brand logos, terms of service, etc., can be stored in a "benchmark site", and other sites can be specifiedsiteIdCall it unified to ensure data consistency and reduce the amount of redundant maintenance work.
  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 improve operational efficiency.
  4. Flexible content aggregation and distribution:You can even create a 'Content Center' site, aggregating selected content from all sub-sites, and then through other sitessiteIdto achieve the secondary distribution and aggregation display of content.

siteIdThe difference with multi-instance deployment

It is worth noting that,siteIdThe parameter is used to manage and distinguish multiple logical sites within an AnQiCMS application instance. This is similar to deploying multiple independent AnQiCMS application instances on the same server (each instance running on a different port, with independentconfig.jsonAnd the process with Go is a different concept.

  • Multiple instance deployment:Each AnQiCMS instance is a completely independent application, with its own configuration files, processes, and possibly independent database connections. They do not have built-insiteIdLinking, if data intercommunication is needed, it is usually realized through API interfaces or other external integration methods.
  • Multi-site management (usingsiteId):All logical sites run on the same AnQiCMS application instance, sharing the same core code and runtime environment.siteIdIs AnQiCMS internal mechanism used to distinguish the data and configuration of these logical sites.

Understanding this distinction is crucial, it can help you choose the most suitable deployment and management strategy according to your actual needs. If you need high physical isolation or a completely independent technology stack, you may choose multiple instances; but if you pursue unified management, resource sharing and efficient operation, AnQiCMS built-in multi-site management and siteIdThe flexible application will be the better solution.


By processingsiteIdA deep analysis of the parameter, we can see that it is not only the foundation of AnQiCMS multi-site management, but also a tool for content operation experts to implement refined and efficient content strategies. Master it proficiently.siteIdThe application will allow you to perform on the AnQiCMS stage