How to call and display specific content or system configuration information from other sites in a multi-site management mode?

Calendar 👁️ 70

AnQiCMS powerful multi-site management function, bringing great convenience to users with multiple brands or sub-sites.It not only allows you to manage different content sites uniformly, but also supports cross-site data sharing and resource integration.When you want to display content from other sites on a site, or call system configuration information from other sites, AnQiCMS provides a simple and efficient mechanism to achieve this goal.

In AnQiCMS, the core of implementing cross-site content or configuration information calls lies in the flexible use of template tags.siteIdA parameter that acts like a site identifier, clearly telling the system which specific site you want to retrieve data from. By specifying this parameter for various content and configuration-related template tags,siteIdYou can easily display the latest articles of the sub-site on your main site, or call the contact information of the corporate website on the product site, etc.

Call content information from other sites

Imagine you have a corporate website and a sub-site dedicated to publishing industry news.If you want to display the latest five news of the sub-site on the homepage of the corporate website, you do not need to copy and paste manually, nor do you need complex secondary development. UtilizearchiveListLabel and specify the sub-site.siteIdand it is done:

{% archiveList latestNews with type="list" limit="5" siteId="您子站的ID" %}
    {% for item in latestNews %}
        <li><a href="{{ item.Link }}">{{ item.Title }}</a></li>
    {% endfor %}
{% endarchiveList %}

here,siteId="您子站的ID"It is the key. It indicates that the system retrieves the article list from the sub-site specified by the ID.

Similarly, if you need to display the detailed information of a specific article, such as a product introduction page, you can usearchiveDetailTags:

{% archiveDetail productDetail with name="Content" id="指定文章ID" siteId="您产品站的ID" %}
    <div class="product-description">{{ productDetail|safe }}</div>
{% endarchiveDetail %}

By specifyingidandsiteId, you can accurately obtain the specific content fields of a specific site.

This mechanism also applies to other types of content tags. For example, if you want to list the category list of a sub-site, you can usecategoryList:

{% categoryList subSiteCategories with moduleId="1" parentId="0" siteId="您子站的ID" %}
    {% for category in subSiteCategories %}
        <a href="{{ category.Link }}">{{ category.Title }}</a>
    {% endfor %}
{% endcategoryList %}

or call the details of a specific single page:

{% pageDetail aboutPage with name="Content" token="about-us" siteId="您子站的ID" %}
    <div>{{ aboutPage|safe }}</div>
{% endpageDetail %}

Even can obtain the tag cloud of other sites or a document list related to a tag, justtagListortagDataListto includesiteIdthe parameter.

Call the system configuration information of other sites

In addition to the content, you may encounter situations where you need to call system configuration information from other sites, such as contact information, website logo, filing number, etc.AnQiCMS provides convenience for this as well.

systemTags allow you to obtain various global system configurations:

<img src="{% system with name="SiteLogo" siteId="您官网的ID" %}" alt="Logo">
<p>{% system with name="SiteCopyright" siteId="您官网的ID" %}</p>

Here, siteId="您官网的ID"You can easily obtain the logo address and copyright information set by the official website, without repeating the configuration on each sub-site.

If you need to display contact information for another site,contactTags also support.siteIdparameters:

<p>联系电话:{% contact with name="Cellphone" siteId="您其他站点的ID" %}</p>
<p>联系邮箱:{% contact with name="Email" siteId="您其他站点的ID" %}</p>

This is particularly useful when building a unified customer service or information display page.

Even the page's TDK (Title, Keywords, Description) information can be accessed throughtdkSpecify the tagsiteIdto call:

<title>{% tdk with name="Title" siteId="您其他站点的ID" %}</title>

Furthermore,navListTags also supportsiteIdThis means you can even display a navigation menu from another site on a site, achieving a higher level of unity and reuse.

How to obtainsiteId

So, how can you know different sitessiteIdWhat? On the AnQiCMS backend management interface, you can view the detailed information of all sites created through the "Multi-site Management" feature, which usually includes a unique identifier for each site, namelysiteId. This ID is usually a number, just replace it in the template tag.siteIdthe parameter.

This cross-site calling capability provided by AnQiCMS greatly enhances the efficiency and flexibility of multi-site operations. Whether it is content aggregation, unified brand image, or centralized management of core information,siteIdParameters all play an indispensable role, making your multi-site ecosystem closer and more efficient.


Frequently Asked Questions (FAQ)

  1. In which types of template tags can I usesiteIdthe parameter? siteIdParameters almost support all AnQiCMS template tags related to content and system configuration, includingarchiveList(Document list),archiveDetail(Document details),categoryList(category list),pageDetail(Single page details),tagList(Tag list),system(System Configuration),contact(Contact information),tdk(Page TDK),navList(Navigation List) etc. Whenever you need to fetch data from a non-current site, you can usually try usingsiteIdparameters to specify the source.

  2. Does calling data from other sites affect the loading speed of the current site?Due to AnQiCMS being a high-performance content management system developed in Go language and usually deployed on the same server for multiple sites, therefore throughsiteIdThe internal data call is usually very efficient, with little impact on the loading speed of the current site.If a large amount of data from other sites is called, or the target site itself has a large amount of data and complex queries, it is still recommended to perform performance testing and consider caching the data to optimize the user experience.

  3. If I specifysiteIdWhat if it does not exist, or the site does not have the content I requested?IfsiteIdThe requested content does not exist or was not found on the target site (for example, the requested article ID does not exist on the target site). AnQiCMS template tags usually return an empty value or an empty collection.This means that your page will not crash due to missing data, but will display a blank space or the alternative information you set up for the 'no content' situation in the template.To improve user experience, it is recommended to add judgment to the tags in the template that may return null values, such as{% if item %}or{% empty %})to deal with this situation.

Related articles

How to use `Json-LD` tags to customize structured data for optimizing the rich text summary display of search engines?

When a search engine displays search results, in addition to simple titles and descriptions, it sometimes also shows images, ratings, prices, authors, and other rich information, which is called 'Rich Snippets'.These eye-catching summaries can effectively enhance the visibility of the website in search results, attract more clicks from users, and thus bring more high-quality traffic to the website.In order to obtain these rich text summaries in search engines, we need to provide search engines with a standardized data format that they can understand, which is called "structured data".Among many structured data formats

2025-11-08

How to retrieve and display the list of all related documents under the Tag detail page?

In content operation, tags (Tag) are an extremely important tool that can help us effectively organize content, improve the quality of internal links on the website, and ultimately improve the user's browsing experience and the search engine's crawling efficiency.By tagging articles, products, or other content with relevant tags, we can associate content with the same theme scattered across different categories, forming a closer knowledge network.

2025-11-08

In the display of the `Content` field of the article, how can I manually control the rendering conversion from Markdown to HTML?

When managing website content in AnQi CMS, we often use Markdown's concise and efficient features to write articles.However, ensuring that this Markdown-formatted content is rendered correctly into attractive HTML on the front-end page can sometimes be a focus for operators.This article will delve into how Anqi CMS handles the Markdown content of the `Content` field of the article, and guide you on how to manually control this rendering conversion process in the template.

2025-11-08

How to truncate a long text content while displaying and automatically add an ellipsis?

In website operation, we often need to display various text content on the page, such as the abstract of article lists, the preview of product introductions, or a brief description of a detailed page.Faced with long-form content, how can one elegantly present the core information within limited space, and guide users to click for more details, is a common need.It is particularly important to truncate long text content and automatically add an ellipsis.AnQiCMS (AnQiCMS) is an efficient and flexible content management system that fully considers this user demand

2025-11-08

How to remove leading and trailing spaces or specific characters from a string in the template using a filter?

In website content display, we often encounter situations where there are extra spaces, line breaks at the beginning and end of strings, or specific characters need to be deleted.These seemingly minor details can affect the layout and aesthetic of the page, the accuracy of data display, and even have an adverse effect on search engine optimization (SEO).AnQiCMS is a powerful template engine that provides rich filter functions, which can help us easily and elegantly handle these strings, making your content more accurate and professional.AnQiCMS's template syntax is concise and intuitive, it draws on Django

2025-11-08

How to perform arithmetic operations such as addition, subtraction, multiplication, and division in the template and display the result?

In AnQiCMS template design, sometimes we need to perform arithmetic operations such as addition, subtraction, multiplication, and division on the numbers displayed on the page to present data more flexibly.Whether it is to calculate the total price of goods, display dynamic percentages, or perform simple processing of certain statistical data, AnQiCMS's template engine provides intuitive and powerful arithmetic calculation capabilities.AnQiCMS's template engine borrows the syntax style similar to Django templates, allowing us to directly output variables in template files (using `{{

2025-11-08

How to customize and display a friendly shutdown notice when the website is in a closed state?

In website operation, we sometimes need to temporarily close the website, whether it is for system upgrades, data maintenance, or short-term business adjustments.It is crucial to display a friendly shutdown prompt to visitors in this case.This not only informs users of the website status, avoids unnecessary confusion, but also maintains the brand image and provides clear guidance for search engines.AnQiCMS (AnQiCMS) provides us with a flexible way to customize and display this information.### Enable website shutdown status and set basic prompts First, you need to set the website to shutdown status

2025-11-08

How to use the `archiveFilters` tag to build a dynamic document filtering feature, such as filtering by product parameters?

Using AnQiCMS's `archiveFilters` tag to build an efficient and practical dynamic filtering function In the field of content management and e-commerce, users being able to quickly and accurately find the information they need is crucial for improving website experience and conversion rates.Imagine, when users browse products or documents on your website, if they can quickly filter out the content they want based on various conditions such as color, size, brand, and even more specific parameters like processor type, memory size, etc., this will greatly enhance their user experience.Provided by AnQiCMS

2025-11-08