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) took this into full consideration from the outset, utilizing a sophisticated mechanism to allow content to be centrally managed in a multi-site environment while also remaining independent and not interfering with each other.
The core mechanism of Anqi CMS for independent content display
The core reason why AnQi CMS can easily handle the independent display of content across multiple sites is that it provides dual physical and logical isolation for each site.From a physical perspective, each site is allocated an independent database and file storage path when created, which ensures the purity of data between sites.From a logical perspective, Anqi CMS utilizes a flexible template tag system, withsiteIdThe parameter enables content to be accurately identified and displayed at template rendering time for the associated site.This design ensures that even under the same system background, the core data and display content of each site are still isolated from each other, without interference.
From site settings to data storage: ensure independence
Firstly, when setting up multiple sites in Anqi CMS, we laid a solid foundation for the independence of content.
When you add a new site in the background, the system will require you to set up 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'.
Secondly, the organization structure of the content also strengthens this independence. Anqi CMS supportsFlexible content modelThis means that each site can customize unique content types such as articles, products, events, and more according to its own business needs.For example, you might have a site focused on technical articles, where you can define the content model of a 'Technical White Paper';Another e-commerce site may need a "product details" model.These models and their associatedCategoryandTagEach will exist independently in their respective site databases, ensuring that content does not cross during publishing, archiving, and retrieval.When you publish content on a site, it will naturally belong to the category and content model of that site and will not appear "unexpectedly" on other sites.
Precisely control the display of content through template tags
The strength of AnQi CMS lies in its template engine's high control over content display. In most cases, when you call the template of site AarchiveList(Document list),categoryList(category list) orpageDetailWhen the system encounters tags like (single page detail) it willautomatically identify the current siteAnd only pull up the content belonging to site A for display. You do not need to make any additional settings to ensure the independence of the content.
However, if you have special requirements, such as displaying the latest products of a child site in 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 a flexible solution. Almost all content-related tags support onesiteIdParameter.
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 the articles of the current site or other sites.Get the system settings of a specific site (such as the website name):
{% system siteName with name="SiteName" siteId="3" %}{{siteName}}This can help you accurately call the website name of other sites in any site template, realizing the display of a small amount of information across sites.
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, you can also do so accuratelysiteIdParameters implementation greatly ensures the flexibility and accuracy of content management.
Visual and brand independence: templates and system settings
The independent display of content not only reflects on the data level, but also on the 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 judgment in a set of templates to display different visual elements based on the site being visited.
For example, you can call the site's Logo, filing number, copyright information, contact information, etc., which can all be configured in the background.Global feature settings/Contact information settingsin modules to independently configure each site.
<img src="{% system with name='SiteLogo' %}" alt="{% system with name='SiteName' %}" />
<p>版权所有:{% system with name='SiteCopyright' %}</p>
When a user visits site A, the logo and copyright information of site A will be displayed;When visiting Site B, Site B's content is displayed. This meticulous independent configuration ensures that each site can have a unique brand image while maintaining the content independent and complete on each site.
In summary, Anqi CMS builds a comprehensive and efficient multi-site content independent display solution through data isolation at the lowest level, flexible content model management, and powerful template tag control.It allows you to focus on managing all websites without worrying about content chaos or incorrect display issues.
Frequently Asked Questions (FAQ)
1. Why does the content I post on Site A not automatically display on Site B?
This is the core feature of 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 templates of AnQi CMS are independent of the content data.Even though all sites use the same template, since each site has its own database and template tags (such asarchiveList/categoryListAnd) when not specifiedsiteIdIt will automatically recognize the current site, so each site will still pull and display its own content.You just need to copy the designed template to the template directory of each site and enable it in the background.
3. How can I display part of the content from another site on a certain site, for example, how to display 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 implement cross-site content calls. For example, using the template in the main station.{% archiveList archives with siteId="子站的ID" limit="3" %}This method can pull the latest 3 articles from the specified sub-site for display. This approach ensures the independence of default content and also provides flexibility for on-demand content sharing.