In the daily operation of Anqi CMS, we often need to deal with various content display requirements and make use of the powerful template tags of the system to achieve these functions. Among them,pageDetailThe tag is a core tool for obtaining detailed content of a single page. A common issue when using this tag is:siteIdWhen should the parameter be set? To accurately answer this question, we need to deeply understand the multi-site management mechanism of Anqi CMS and the working principle of its template tags.
pageDetailLabel and default behavior
pageDetailThe main function of the tag is to obtain detailed information of a specific single page, such as the title, content, links, thumbnails, etc. In most cases, when we display the single-page content of a website itself, we usually use it in this way:{% pageDetail with name="Title" %}Or{% pageDetail with name="Content" id="1" %}.
Under the default usagepageDetailThe tag automatically identifies the context of the current website and retrieves the required single-page information from the data of the current website. Whether it is throughidSpecify a specific single page or let the tag automatically retrieve the single page corresponding to the current URL, the system will assume that you are querying the page data of the current active site. Therefore, when deploying on a single site or querying data for the current site,siteIdThe parameter is completely unnecessary to set.
Background and role of multi-site management
One of the core advantages of AnQi CMS lies in its powerful multi-site management capabilities.It allows users to create and independently manage multiple websites under the same system architecture, which is extremely convenient for enterprises and operation teams with multiple brands, sub-sites, or the need to integrate different content branches.Each site can have its own independent content, templates, settings, even databases (when deployed with Docker or with multiple database configurations), but they share the same safe CMS management backend.
The core value of multi-site management lies in: a unified platform, decentralized management.It reduces the complexity of deploying and maintaining multiple systems while also allowing each site to maintain the independence of its content.
siteIdThe real purpose of the parameter
siteIdThe parameter setting scenario is the key point of combining the AnQi CMS multi-site management function with template tags.
Only when you are in a multi-site AnQi CMS environment and need toNot currently an active siteWhen obtaining single page detail data,siteIdParameters become indispensable. In other words, if you are visiting site A, but your template needs to display a certain "About Us" page on site B (this is a single page), then you call it in the template of site ApageDetailWhen labeling, you need to explicitly specify the site B'ssiteId.
For example, if you want to display on the current sitesiteIdWith2The ID of another site is1Use the single page title like this:{% pageDetail with name="Title" id="1" siteId="2" %}. The system will use the one you providedsiteId, to retrieve the data of a specified single page across sites instead of from the current site (assuming itsiteIdis not 2)检索。
In summary,siteIdThe parameter is to achievecross-site content referencedesigned.It allows operation personnel to flexibly call and display specific single-page content managed by an AnQi CMS on another site within a site.siteIdParameter.
Frequently Asked Questions (FAQ)
1. I only have one secure CMS website,pageDetailTags need to be setsiteId?It is not necessary. If you have only one Anqi CMS website instance, or in a multi-site environment you always only query the content of the site being visited, thensiteIdThe parameter is not necessary, the system will automatically obtain data from the current site.
2. How to know about another website.siteIdare?On the AnQi CMS backend management interface, you can view the list of all sites created through the "Multi-site Management" feature. Each site usually has a unique identifier, including itssiteIdThis ID is a critical parameter used internally by the system to distinguish different sites.
3.siteIdThe parameter is only applicable topageDetailAm I supposed to use the label?Not.siteIdIs an Anqi CMS template tag parameter, it is commonly used for tags that need to specify the data source site, for examplearchiveDetail(Document Details),categoryDetail(Category Details),system(System settings),contact(Contact information) and various list tags such asarchiveList/pageListIt is used to implement cross-site data calls in a multi-site environment.