As an experienced CMS website operation personnel for AnQi, I fully understand the importance of efficient content management in a multi-site environment, especially the need to batch import a large amount of content into a specific site.The multi-site function of AnQi CMS provides strong flexibility for content operation, and the batch import capability further improves work efficiency.
The following is a detailed guide on how to batch import content into the specific site of AnQiCMS multi-site.
How to batch import content into a specific site of AnQiCMS multi-site?
The multi-site management feature of AnQiCMS allows users to manage multiple independent websites within a single system.When you need to fill a large amount of content for a specific site manually one by one, it is obviously inefficient.It is fortunate that AnQiCMS provides a content import API interface, making it possible to import batch content into a specified site.
Preparation
Before you start the batch import of content, there are several key preparation steps that need to be completed to ensure the smooth process of import and the accuracy of data.
Firstly, ensure that your AnQiCMS multi-site environment is correctly set up and running.This means that you have already created the target site for importing content through the "Multi-site Management" feature in the AnQiCMS backend, and the site can be accessed and managed normally.docker-bt-proxy.mdorinstall.mdTutorial completed.
其次,You need to have a clear understanding of the content model of AnQiCMS. AnQiCMS supports a flexible content model (help-content-module.md),including the default "article model" and "product model", as well as models that you can customize according to your business needs.Understanding the field structure of these models is the key to correctly mapping the data you are about to import.
The third point, and the most crucial one, is to obtain the unique identifier of your target site.siteId. ThissiteIdIt is the key to distinguish different sites when AnQiCMS is processing multi-site data.You can find the ID of each site in the "Multi-site Management" list on the AnQiCMS backend.siteIdTo guide the content into the correct site.
Finally, prepare the content data you wish to import.This data is usually organized in structured file formats (such as CSV or JSON) for programmatic reading and processing.Ensure that your data fields correspond one by one to the AnQiCMS content model fields for accurate import later.
Core strategy: Utilize the content import API interface
One of AnQiCMS' advantages lies in its powerful extension capabilities, including the ability to import articles and products via API interfaces newly added in the version.v2.1.0Version of new "Article, Product Import API Interface" (changelog.mdEnglishThis is the most effective and flexible way to implement batch data import, especially for specific sites.Through the API, you can write scripts to programmatically push a large amount of structured content accurately to the AnQiCMS site you specify.
To use this feature, you first need to access the "Function Managementhelp-index.mdHere, detailed instructions or necessary parameter information about how to configure and use the import API are usually provided.
When importing content through the API,siteIdParameters play a crucial role. Many template tags in AnQiCMS, such astag-/anqiapi-archive/142.htmlandtag-/anqiapi-archive/141.html, all explicitly mentionsiteIdParameters used to call specific site data in a multi-site environment. This indicates that when performing content import, you must explicitly include the target site in the API request.siteIdTo ensure that the content is correctly routed to the specific site instead of the default site or other sites.
Detailed import steps
We will divide through the use of the API interface,