How to ensure that each site's content is independently displayed under multi-site management?

How to ensure that each site's content can be displayed independently when managing multiple websites is a common challenge faced by many content operators.Fortunately, AnQiCMS (AnQiCMS) fully considered this from the very beginning of its design, using a wonderful mechanism to allow content to be centrally managed in a multi-site environment while also remaining independent, not interfering with each other.

The core mechanism of Anqi CMS for achieving independent content display

The core reason why Anqi CMS can easily manage independent content display for multiple sites is that it provides dual isolation, both physical and logical, for each site.From a physical perspective, each site is allocated an independent database and file storage path when created, ensuring the purity of data between sites.siteIdThe parameter allows content to be accurately identified and displayed at the site level during template rendering.This design ensures that even under the same system backend, the core data and display content of each site are isolated from each other and do not interfere with each other.

From site settings to data storage: Ensure independence

Firstly, when setting up multiple sites in AQ CMS, we laid a solid foundation for content independence.

When you add a new site in the background, the system will require you to set an independentSite Root DirectoryandDatabase name. For example, if your main site usesanqicms.com, then the new site can be set to/app/dev_anqicms.comas the root directory,dev_anqicms_comAs a database name.This configuration means that each site is completely independent in file storage (such as images, attachments) and data storage (articles, categories, users, etc.), without affecting each other.Even on the same server, different websites have their own 'territories'.

其次,内容的组织结构也强化了这种独立性。English CMS支持Flexible Content ModelThis means that each site can customize unique content types such as articles, products, and events according to its own business needs.For example, you may have a site focused on technical articles, which can define a "Technical White Paper" content model; another e-commerce site may require a "Product Details" model.Categoryandtagswill independently exist in their respective site databases, ensuring that content will not cross during publishing, archiving, and retrieval.When you post content on a site, it will naturally belong to the category and content model of that site, and will not "accidentally" appear on other sites.

通过模板标签精确控制内容显示

The strength of AnQi CMS lies in its template engine's high control over content display. In most cases, when you callarchiveList(Document List),categoryList(Category List) orpageDetail(Single page detail) tags, the system willautomatically recognize the current siteand only pull the content belonging to site A for display. No additional settings are required to ensure the independence of the content.

However, if you have special requirements, such as needing to display the latest products of a sub-site at a corner of the main site, or hoping that a global navigation bar can display different links based on the site visited by the user, AnAnQi CMS also provides flexible solutions. Almost all content-related tags support asiteIdParameter.

For example:

  • Get the list of articles from a specific site:

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

    Here,siteId="2"Explicitly instruct the system to retrieve the latest 5 articles from the site with ID 2, without confusing articles from the current site or other sites.

  • Get the system settings of a specific site (such as the site name):

    {% system siteName with name="SiteName" siteId="3" %}{{siteName}}
    

    This can help you accurately call the site name of other sites in any site template, realizing the display of a small amount of inter-site information.

Through such a mechanism, each site defaults to displaying only its own content, and if you indeed need to break this independence for a small amount of content linkage, it can also be achieved through precisesiteIdParameter implementation, greatly ensures the flexibility and accuracy of content management.

Visual and brand independence: template and system settings

Content is independently displayed not only at the data level, but also reflected in visual and brand recognition. Anqi CMS'sTemplate DesignAllow each site to have a completely independent interface style.You can upload and configure different templates for each site, or use conditional statements within a set of templates to display different visual elements based on the current site being visited.

For example, you can call the site's logo, filing number, copyright information, contact information, and other information in the template, all of which can be configured independently in the background.[en] Global function settings/Contact information settingsin each module.

<img src="{% system with name='SiteLogo' %}" alt="{% system with name='SiteName' %}" />
<p>版权所有:{% system with name='SiteCopyright' %}</p>

When the user visits site A, the logo and copyright information of site A will be displayed; when visiting site B, then the logo and copyright information of site B will be displayed.This meticulous independent configuration ensures that each site can have a unique brand image while keeping the content independent and complete on each site.

In summary, Anqi CMS builds a comprehensive and efficient multi-site content independent display solution by isolating from the underlying data, to flexible content model management, and to powerful template tag control.It allows you to focus on managing all websites without worrying about content chaos or improper display issues.


Common Questions (FAQ)

1. Why doesn't the content I post on site A automatically display on site B?

This is the core feature of the Anqi CMS multi-site design.Each site has an independent database and file storage path at the bottom level, and the content data is naturally isolated.When you publish content in the backend of site A, this content will only be written to the database of site A and will be displayed by default in the template of site A.This design is to ensure the independence of content for each site, avoiding content confusion.

2. Can I let multiple sites use the same template but still display independent content?

Absolutely.The template of Anqi CMS is independent of the content data.archiveList/categoryListetc.) when not specifiedsiteIdWhen it is triggered, it will automatically recognize the current site, so each site will still pull and display its own content.You only need to copy the designed template to the template directory of each site and enable it in the background.

3. If I want to display part of the content from another site on a certain site, for example, how to show the latest news from a child site on the main site?

This is an advanced application scenario supported by AnQi CMS. You can specify it explicitly in the template tags.siteIdParameters can be used to call content across sites. For example, in the template of the main site, you can use{% archiveList archives with siteId="子站的ID" limit="3" %}This way, you can pull the latest 3 articles from the specified sub-site for display. This method ensures the independence of default content while also providing flexibility for content sharing as needed.