How to effectively guide users to discover more interesting content in a content management system is the key to improving user experience and website depth.AnQiCMS handles the "related document list" feature by providing a flexible and intelligent mechanism that allows us to easily display other articles or products closely related to the current content on the website. This not only helps to extend the user's stay time on the website but also improves the search engine crawling efficiency through internal links.
The core mechanism of the AnQiCMS related document list
AnQiCMS via its powerful template tag system, especiallyarchiveListThe tag implements the display of related documents. This tag itself is used to call various document lists, but when we want it to display 'related' content, we just need to specifytype="related"this parameter.
ThisarchiveListLabels are usually used on document detail pages, where they intelligently or on demand filter out other related documents based on the information of the current document.
Intelligent recognition logic for related documents
AnQiCMS uses various logic to determine which documents are 'relevant', allowing us to choose the most suitable recommendation method based on actual operational needs:
Based on classification and proximity (default logic)When we are in
archiveListSet in the labeltype="related"If no other more specific conditions are specified, AnQiCMS will default to a more intuitive association method: it will look for the document associated with the current onethat belongs to the same categoryOther documents. In these documents of the same category, the system tends to recommend those that are published earlier or have a higher document ID.Close toThe document. This ensures consistency in the context of recommended content, making it easier for users to discover other in-depth content under the same topic when reading an article on a particular topic.Keyword-driven association
like="keywords")AnQiCMS also allows us to utilize the document'sKeywordsRecommend relevant content more intelligently. After we set keywords for the document (which can be manually entered in the document editing interface or selected from the keyword library), the system can use these tags for matching.If we arearchiveListadd alike="keywords"This parameter, AnQiCMS will identify the first keyword of the current document and use it as a basis to search for other documents that contain the same keyword.This method is very useful in scenarios where content crossover and classification is not detailed enough, as it can recommend content across categories.artificially selected strong association
like="relation")In certain specific cases, we may need to exercise more precise manual control over related documents.For example, you would like to display a specific case study below a specific product page or recommend a specific technical article at the bottom of a specific service introduction page.AnQiCMS provides the function to manually set "related documents" in the document editing interface.When we chooselike="relation"when this parameter is set,archiveListtags will only display those that weSpecify explicitly in the background as associateddocument. This method gives the operator great freedom, allowing for precise content recommendations based on content strategy.
How to call and display in the template
Understanding the logic behind, we can flexibly apply it in the template. Here are some common calling examples:
A basic, displaying related documentsarchiveListThe tag usually would be like this:
{# 显示与当前文档同分类且临近的10篇相关文档 #}
<div class="related-docs">
<h3>相关推荐</h3>
<ul>
{% archiveList archives with type="related" limit="10" %}
{% for item in archives %}
<li>
<a href="{{item.Link}}" title="{{item.Title}}">
{% if item.Thumb %}<img src="{{item.Thumb}}" alt="{{item.Title}}">{% endif %}
<h4>{{item.Title}}</h4>
<p>{{item.Description|truncatechars:80}}</p>
<span>发布于:{{stampToDate(item.CreatedTime, "2006-01-02")}}</span>
</a>
</li>
{% empty %}
<li>暂无相关文档。</li>
{% endfor %}
{% endarchiveList %}
</ul>
</div>
If we need to match more broadly based on keywords, we can modify it like this:
{# 基于当前文档关键词,显示10篇相关文档 #}
<div class="related-by-keywords">
<h3>基于关键词的推荐</h3>
<ul>
{% archiveList archives with type="related" like="keywords" limit="10" %}
{% for item in archives %}
<li>
<a href="{{item.Link}}" title="{{item.Title}}">
<h4>{{item.Title}}</h4>
<span>{{stampToDate(item.CreatedTime, "2006-01-02")}}</span>
</a>
</li>
{% empty %}
<li>暂无基于关键词的相关文档。</li>
{% endfor %}
{% endarchiveList %}
</ul>
</div>
And for those scenarios that require fine-grained manual configuration in the background, we can use:
{# 显示后台手动关联的文档 #}
<div class="related-by-manual">
<h3>运营精选推荐</h3>
<ul>
{% archiveList archives with type="related" like="relation" limit="10" %}
{% for item in archives %}
<li>
<a href="{{item.Link}}" title="{{item.Title}}">
<h4>{{item.Title}}</h4>
<p>{{item.Description|truncatechars:100}}</p>
</a>
</li>
{% empty %}
<li>暂无人工精选推荐文档。</li>
{% endfor %}
{% endarchiveList %}
</ul>
</div>
In these loops,itemvariables provide rich fields such asId/Title(Title),Link(Link),Description(Description),Thumb(thumbnail),CreatedTime(Creation time) etc., we can freely call according to design requirements.
Summary
AnQiCMS usesarchiveListtags and theirtype="related"Parameters combined with various intelligent recognition logic provide great convenience for website content operations.Whether it relies on the system's default classification and proximity, or matches widely through keywords, or uses人工精选 for precise recommendation, AnQiCMS can help us easily build a website content ecosystem with depth and user stickiness.Adopt these features flexibly to make your website content more attractive, and users can also explore the information you provide more smoothly.
Frequently Asked Questions (FAQ)
Question: Why does my related document list always not display or show very few items? Answer:This usually has several reasons. First, please check if there are enough other documents under the category of the current document; second, if you have used
like="keywords"Please confirm whether the current document has set keywords and whether other documents also contain these keywords. If usedlike="relation"Ensure that other documents are manually associated during document editing in the background. In addition,limitParameters also limit the number of displayed items; if set too small, only a few articles may be displayed.Ask: Can I use multiple related document recommendation logic on a single page? Answer:Yes. Although
archiveListlabel'slikeYou can only select one logic at a time for the parameters (for examplelike="keywords"orlike="relation"But you can call it multiple times in the same document detail pagearchiveListDifferent tags each timelikeParameters, and layout on the page into different recommendation modules, such as "You may also like (based on category)", "Hot keyword recommendations", or "Editor's picks" and so on.What does the 'closeness' refer to specifically in the recommendation logic of the relevant documents? Is it based on ID or publication time? Answer:In the default related document recommendation logic of AnQiCMS, "closeness" usually refers to the adjacency relationship of documents in the order of publication or system ID.It is determined by ID, publication time, or other factors, depending on the internal sorting mechanism of the system, but the core is that within the same category, the system tends to recommend documents that are close to the current document in terms of data, in order to ensure some timeliness or logical relevance of the content.