AnQiCMS was designed from the beginning to fully consider the needs of enterprises and content operators for multi-site management and is committed to providing a highly efficient and independent solution.When you create multiple sites in AnQiCMS, the system ensures that each site's page content can be displayed independently, without interference, while also allowing limited cross-site content interaction when needed.

Logical isolation and data independence of sites

The core of AnQiCMS ensuring independent display of content across multiple sites lies in its logical isolation and data management for each site.In the system, each site created is considered an independent operating entity.This means that each site has its own independent configuration information, including domain names, file storage paths, and more importantly, they can have their own independent databases.

For example, when we add a new site through the multi-site management feature of AnQiCMS, the system will guide us to specify a separate database name for the new site.This, the articles, products, categories, single pages, and all content data of site A are stored in the corresponding database of site A, while the content of site B is stored in the database of site B.This physical level of data isolation is the cornerstone of independent content display, ensuring that data between sites will not be confused or accidentally leaked.Even when deploying AnQiCMS in a Docker environment, when adding a new site through the Baota panel, an independent root directory and database will be set for each site, further strengthening this data isolation.

Flexible content model support

The flexibility of the content model is another key factor for AnQiCMS to maintain the independence of the site's content.Each site can customize a unique content model according to its specific business needs.For example, an e-commerce site may need a "product" model, which includes fields such as price, inventory, etc.And a news information site may need an 'article' model, including author, source, and other fields.

This custom capability means that site A can define a content structure that is completely suitable for its business, and site B can also define a completely different content structure.Administrators of each site can create or modify content models based on the positioning of their site, and these models and the associated content only affect the current site.When you publish a 'product' on site A, it will only appear in the management backend and frontend pages of site A, and will not be mistakenly displayed on site B, even if site B also has a content model named 'product', they operate independently.

Intelligent recognition and invocation of the template system

The final decision on how the content is presented to the user is the site's template system.AnQiCMS uses a highly flexible and intelligent template engine (similar to Django templates), ensuring that each site's template can be independently customized and called, thereby achieving independent display of content.

Each site can have its own independent set of template files. The system determines which site's template to load by identifying the current domain being accessed. For example, accessingsiteA.comWill load the site A's/template/siteA_theme/template under the directory, when accessingsiteB.comWill load the site B's/template/siteB_theme/template. Inside these templates, when usingarchiveList/categoryDetailorpageDetailWhen using tags to retrieve content, the AnQiCMS engine automatically identifies the current site context and fetches data for rendering from the database associated with the current site.This means that even if the template code structure of two sites is similar, due to the different site contexts they are in, the actual content displayed will be independent data for each.

Further, template tags will default to fetching data from the current site without any additional specificationsiteIdParameters. This context-sensitive mechanism greatly simplifies the work of template developers, allowing them to focus on the style and content layout of the current site without worrying about confusing data from other sites.Of course, AnQiCMS also providessiteIdParameters, allow cross-site content calls in special cases, but this is an explicit, purposeful action that will not cause passive confusion.In addition, AnQiCMS also supports specifying custom templates for specific categories, documents, or single pages, which gives each site the ultimate flexibility and independence in content display.

Through the above layer-by-layer progressive mechanism, AnQiCMS provides strong independence guarantee for each site from data storage, content structure definition to the final page rendering, making the content under multi-site management clear and accurately displayed independently.


Frequently Asked Questions (FAQ)

1. How does AnQiCMS ensure the independence of multi-site content at the file system level?

AnQiCMS ensures content independence at the file system level by setting up a separate website root directory for each new site. When creating a new site, you need to specify a different website root directory (such as/app/dev_anqicms_comThis directory is used to store the cache, uploaded files, images, and other resources of the site.This means that uploaded images and files for different sites will be stored in their respective directories and will not overlap or confuse.Combine with an independent database, data and files are effectively isolated.

Can I reference or display content from another site on a site?

Yes, AnQiCMS provides this flexibility. Although by default the content of each site is independent, but by explicitly using the template tags in the template.siteIdParameter, you can implement cross-site content referencing and display. For example, in the template of site A, you can use{% archiveList archives with siteId="站点B的ID" limit="5" %}Fetch and display the latest article list of site B. This allows you to achieve necessary inter-site content linkage while maintaining the independence of the sites.

If my multiple sites use the same template theme, will their content display independently?

Will do. The template theme only determines the layout and style of the website, while the source of the content is determined by the context of the current site and its associated database.Even if both Site A and Site B use the "default theme", when a user visits Site A, AnQiCMS will load the corresponding database content based on the domain name of Site A;When visiting site B, the content of site B database will be loaded.Therefore, the appearance may be consistent, but the content displayed internally is still independent of each other.