In AnQiCMS, managing and displaying the content of multiple websites is a common need for many operators, especially when you need to manage multiple brand sites, product sub-sites, or provide customized content for users in different regions or languages.AnQiCMS was designed with this in mind from the beginning, providing a flexible and efficient solution that allows you to easily manage the content of multiple front-end sites from a single backend.
Backend unified management: one system, multiple sites
One of the core advantages of AnQiCMS is that it supports multi-site management, which means you do not need to deploy a separate CMS system for each website.All sites, regardless of content type, language, or target audience, can be managed through the same AnQiCMS backend.
When you need to create a new site in AnQiCMS, the operation process is very intuitive.Navigate to the "Multi-site Management" feature in the backend, and you will see an option to "Add a New Site".Here, you need to configure some basic information for the new site:
- Site name: It makes it easy for you to identify and distinguish different sites in the background.
- Site root directory: AnQiCMS will create an independent storage space for each site, mainly used to store the site's cache, uploaded files, and other data, ensuring data isolation and non-interference between sites.You can specify a unique directory name for the new site.
- website address: This is the domain name or URL used by users to access the new site.
- Administrator account and password: Set up independent backend login credentials for the new site, for fine-grained permission management.
- Database nameIt is strongly recommended to configure an independent database for each new site to ensure data independence and security.Of course, if you wish to create multiple databases under the same database service, you can choose to 'reuse the default database account information', just provide the new database name.
- Select the template to use: Specify a set of frontend display templates for the new site, giving it a unique appearance and layout.
With such configuration, each site has its independent content storage, independent administrator account, and independent front-end template, but their management entry is unified.You can switch and manage all content such as articles, products, categories, single pages, and SEO settings for different sites on the same admin interface, greatly reducing repetitive operations and management costs.
Unified display on the front-end: Flexible cross-site content call
The cleverness of AnQiCMS lies in the fact that it not only implements unified management on the backend, but also provides powerful front-end content call capabilities, allowing you to easily integrate and display content across sites.This means that even if your content is distributed across multiple logical sites, you can flexibly retrieve and display the content of other sites on any frontend site.
The key to realizing this feature lies in the AnQiCMS template tagssiteIdParameters. Almost all tags involving content calls, such asarchiveList(Document list),categoryList(Category list),pageList(Single-page list),navList(Navigation list) evensystem(System information) andcontact(Contact information) etc., all supportsiteIdParameter.
For example, suppose you have a main brand website (Site A, ID 1) and also operate a product introduction website (Site B, ID 2).Now, you want to display the latest product list of the product website (Site B) on the homepage of the main brand website (Site A).You just need to use in the home page template of Site A,archiveListwhen labelingsiteId="2"Just set the parameters:
{# 在Site A的模板中,调用Site B(ID为2)的最新5个产品 #}
{% archiveList latestProducts with siteId="2" moduleId="产品模型ID" limit="5" %}
{% for product in latestProducts %}
<div>
<h3><a href="{{ product.Link }}">{{ product.Title }}</a></h3>
<p>{{ product.Description }}</p>
</div>
{% endfor %}
{% endarchiveList %}
Similarly, you can also aggregate and display popular articles from multiple sub-sites on a portal site; or display contact information from different sub-brands at the bottom of the corporate website. By specifying preciselysiteIdYou can break the content boundaries, achieving real content sharing and unified display.
In addition, AnQiCMS also provideslanguagesThe tag is used specifically for switching and displaying between multilingual sites. If your multiple sites correspond to multiple language versions of the same content, throughlanguagesLabel, allowing users to conveniently switch between different language sites while ensuringhreflangProper configuration of SEO elements to help your website gain better visibility globally.
Application scenarios in practice
This capability of unified management and display across multiple sites provides a solid foundation for various complex operational needs:
- Corporate group portalThe main site serves as a brand image display, with each sub-site responsible for specific product lines or service introductions. The main site can optionally aggregate and display the latest dynamic information of each sub-site.
- Multilingual international websiteTo provide localized content for different countries or regions, each language version is an independent site, through
siteIdEnable language switching between pages, enhance user experience, and optimize international SEO. - Content aggregation and distributionOperate an industry portal website, manage the content of different topics or channels separately through independent "sites", and then integrate and display them uniformly on the main portal page, making it convenient for content editing and publishing while maintaining a clear structure.
In summary, the multi-site management feature of AnQiCMS makes content operation more efficient and flexible.It simplifies the originally complex maintenance of multiple websites, empowering you to freely arrange content between sites with powerful frontend calling capabilities, and builds a powerful, smooth digital asset matrix.
Frequently Asked Questions (FAQ)
1. How do I know each site?siteIdWhat is it?
In AnQiCMS backend, when you enter the 'Multi-site Management' page, you will see a list of all the sites you have created. Typically, each site will have a unique ID, and you can find the corresponding one in this list.siteId. This ID is the unique credential used internally to identify the site, and it needs to be used accurately when calling cross-site content in the template.
2. Will calling a large amount of content from multiple sites on a front-end page affect website performance?
AnQiCMS is developed in Go language and has the architectural advantages of high performance and high concurrency.We also considered the efficiency of content calls during design. However, calling too much content from different sites on a single page may still increase the server load and page loading time.It is recommended to follow the principle of 'loading on demand, and minimal invocation' in design, for example, limiting the number of content calls (limitParameters), or utilize the page caching mechanism to optimize performance.
3. Can I let different sites share the same article or product data completely, instead of calling and displaying across sites?
The multi-site design concept of AnQiCMS provides an independent database for each site to ensure data isolation and management flexibility.Therefore, by default, an article or product data belongs to a specific site.Cross-site calling is a "display" mechanism, not a "sharing" mechanism, that is, data is pulled from Site A to Site B for display, but the data itself is still stored on Site A.If you indeed need to make multiple sites share the same content data completely, you may need to consider manually synchronizing the same content to other sites at the time of content publishing (through the content collection and batch import function of AnQiCMS, or the API interface can simplify this process), or through customized development to achieve a deeper level of data sharing logic.