Hello, everyone, website operators and colleagues,

In the multi-site management environment of AnQiCMS, how to efficiently and accurately call content has always been a focus of everyone. Today, let's delve into a common problem in template creation:prevArchiveCan the tag access documents cross-site?

The essence of AnQiCMS multi-site architecture

Let's review the multi-site management feature of AnQiCMS.AnQiCMS is renowned for its powerful multi-site support, allowing us to create and independently manage multiple websites within a single system, which is undoubtedly a great convenience for enterprises with multiple brand sub-sites or different content branches.This design aims to unify the content management process, optimize resource allocation, while ensuring the independence and flexibility of content at each site.Each site may share the core services and backend management interface of AnQiCMS, but on the content level, they are often relatively independent logical units.

prevArchiveThe responsibilities and limitations of the tag

prevArchiveThe tag in the AnQiCMS template plays a major role in helping us easily jump to the 'previous' document when browsing a document.This is usually used to implement a continuous reading experience on article detail pages, such as the 'Previous Article' link in a blog.According to AnQiCMS's document instructions,prevArchiveThe design of the tag is very simple and clear, its usage method is{% prevArchive prev %}and explicitly states“prevArchive does not support parameters.”

This key information tells us,prevArchiveWhen the tag is called, it does not provide such assiteIdThis parameter is used to specify which site to retrieve the document from. This means that it will default to searching within the site being visited for the 'previous' document.It searches for documents that belong to the same content stream, category, and are immediately preceding in terms of publication time or ID sorting.

This contrasts with, many other data call tags in AnQiCMS are explicitly supportedsiteIdParameter.For example,archiveList(Document list),archiveDetail(Document details, when specifying an ID),categoryList(Category list),pageList(Single page list) even issystem(System settings) andcontact(Contact information) tags can be usedsiteIdParameters are used to specify the data to be obtained from a specific site. This indicates that AnQiCMS has a clear consideration and implementation mechanism for cross-site data acquisition, butprevArchiveit is obviously not included.

WhyprevArchiveTags do not support cross-site access?

This is not a missing in AnQiCMS design, but more likely based on careful consideration of the navigation logic of 'Previous/Next'.

  1. Logical coherence is prioritized:Navigation between "Previous" and "Next" usually emphasizes the sequential and coherent nature of the content in terms of time or theme.If you arbitrarily jump across sites, this logical consistency may be broken.The user is reading an article on a site and suddenly jumps to an unrelated article on another site, which will make the reading experience very abrupt.
  2. Content context is independent:Even though AnQiCMS supports multiple sites, the content system (categories, models, tags, etc.) of each site is typically independent.It is relatively straightforward to determine the "previous article" within a single site, but to define the "previous article" across sites, a complex set of cross-site content relationship definitions and sorting rules is needed, which will greatly increase the complexity of the system and may not be widely applicable in practical scenarios.
  3. Performance and query efficiency:Implementing cross-site "Previous" search means that complex joint queries or traversal need to be performed in multiple site databases, which may cause unnecessary impact on system performance.While limited to searching within the current site, it can ensure a fast and efficient response.

Therefore,prevArchiveLabels are designed to strictly operate within the current site context and are consistent with their core function positioning and the overall design philosophy of the system.

Considerations in actual operation.

In actual operation, if you need to implement a form of "related content recommendation" or "traffic redirection" in the multi-site environment of AnQiCMS, rather than the strict sense of the "previous article" document, you should consider using supportsiteIdofarchiveListLabel. For example, on an article detail page of a product site, you can usearchiveListtags, throughsiteIdParameters to retrieve several recommended articles from another associated site (such as a brand story site or a technology blog site). This method is more in line with the actual needs of cross-site content interaction.

In short,prevArchiveThe tag in the AnQiCMS multi-site management environment cannot access documents across sites.It faithfully fulfills its responsibility to provide seamless reading navigation within the current site.Understanding this design helps us better utilize the various functions of AnQiCMS and build a high-efficiency, user-friendly website group.


Frequently Asked Questions (FAQ)

  1. nextArchiveCan the tag retrieve documents across sites? nextArchivewith the tag andprevArchiveThe tag function is similar, used to retrieve the 'next document', its design does not accept any parameters either, so it cannot retrieve documents across sites. It andprevArchiveThe same, only works within the current site context.

  2. If I need to recommend related articles from other sites on the document detail page, which tag should I use?You can usearchiveListtags, and combinesiteIdSpecify the parameter to indicate which site to get the recommended article list from. For example,{% archiveList relatedDocs with type="list" siteId="2" limit="5" %}It will fetch the latest 5 documents from site ID 2 as recommendations.

  3. All data call tags in AnQiCMS are supportedsiteIdAre the parameters?Not all tags are supportedsiteIdAs mentioned in the article,prevArchiveandnextArchiveNot supported. But most are used to retrieve list or specific details (by specifying ID or Token) data tags, such asarchiveList/archiveDetailat specified ID,categoryList/pageList/tagListand others are supported.siteIdParameters to flexibly call data from other sites in a multi-site environment.