Hello, all website operators.
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 that often occurs in template creation: prevArchiveThe tag can be accessed across sites to obtain documents?
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. This is undoubtedly a great convenience for enterprises that have multiple brand subsidiaries or different content branches.This design aims to unify the content management process, optimize resource allocation, while ensuring the independence and flexibility of each site's content.Each site shares 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 main function of the tag in AnQiCMS template is to help 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 blogs.prevArchiveThe design of the tag is very simple and clear, its usage method is{% prevArchive prev %}and clearly states“prevArchive does not support parameters.”
This key information tells us,prevArchivewhen the label is called, it does not provide such assiteIdThis parameter specifies from which site to retrieve the document.This means, it defaults to searching for the "previous" document within the site currently being accessed.It searches for documents that belong to the same content stream, the same category, and are immediately preceding in terms of publication time or ID sorting.
This is in sharp contrast to, many other data call tags in AnQiCMS are explicitly supported.siteIdParameter.For example,archiveList(Document List),archiveDetail(Document details, specified ID),categoryList(category list),pageList(Single page list) even issystem(System Settings) andcontact(Contact information) tags, can all besiteIdParameters can be used to specify the data to be retrieved from a specific site. This indicates that AnQiCMS has a clear consideration and implementation mechanism for cross-site data acquisition during design.prevArchiveIt is not included in it.
WhyprevArchiveLabel does not support cross-site access?
This is not a design flaw of AnQiCMS, but rather a deliberate consideration of the navigation logic of 'Previous/Next article'.
- Logical consistency first:“Previous” and “Next” navigation usually emphasizes the sequence and coherence of content in time or theme.If you arbitrarily cross sites, this logical consistency is very likely to be broken.A user is reading an article on a site and suddenly jumps to an entirely unrelated article on another site, resulting in a very abrupt reading experience.
- Content context independent:Although AnQiCMS supports multiple sites, the content system (categories, models, tags, etc.) of each site is usually independent.It is relatively straightforward to determine the 'Previous Article' within a single site, but to define it across sites requires a complex set of cross-site content relationship definitions and sorting rules, which will greatly increase the complexity of the system and may not be widely applicable in practical scenarios.
- Performance and query efficiency:Implementing cross-site "previous" search means that complex joint queries or traversal across multiple site databases is required, which may have an unnecessary impact on system performance.If limited to searching within the current site, it can ensure a quick and efficient response.
Therefore,prevArchiveThe label is designed to strictly operate within the current site context, which is consistent with its core functional positioning and the overall design philosophy of the system.
Considerations in actual operation
In actual operation, if you need to implement some form of 'related content recommendation' or 'traffic redirection' in the multi-site environment of AnQiCMS, rather than the strict sense of 'previous article' document, you should consider using supportsiteIdofarchiveListTag. For example, on an article detail page of a product site,archiveListTags, throughsiteIdParameters can be used to obtain several recommended articles from another associated site (such as a brand story site or a technical blog site). This approach 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 the responsibility of providing seamless reading navigation within the current site.Understanding this design helps us better utilize the various functions of AnQiCMS to build a high-efficiency and user-friendly website group.
Common Questions (FAQ)
nextArchiveLabel can access documents across sites?nextArchiveTags andprevArchiveThe label function is similar, used to obtain the "next" document, and its design does not accept any parameters either, so it cannot access documents across sites. It andprevArchiveThe same, only works within the current site context.If I need to recommend related articles from other sites on the document detail page, which tag should I use?You can use
archiveListtags, and combinesiteIdParameters are used to specify from which site to fetch the list of recommended articles. For example,{% archiveList relatedDocs with type="list" siteId="2" limit="5" %}The latest 5 documents from the site with site ID 2 will be obtained as recommendations.All data call tags in AnQiCMS support
siteIdthe parameter?Not all tags supportsiteId. As mentioned in the article,prevArchiveandnextArchiveIs not supported. But most are used to retrieve lists or specific details (specified by ID or Token) such asarchiveList/archiveDetail(when a specific ID is specified),categoryList/pageList/tagListetc., are supportedsiteIdParameters for flexible access to data from other sites in a multi-site environment.