How to display the list of related documents in AnQiCMS, what is the logic?

Calendar 👁️ 61

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:

  1. Based on classification and proximity (default logic)When we are inarchiveListSet 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.

  2. Keyword-driven associationlike="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.

  3. artificially selected strong associationlike="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)

  1. 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 usedlike="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.

  2. Ask: Can I use multiple related document recommendation logic on a single page? Answer:Yes. AlthougharchiveListlabel'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.

  3. 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.

Related articles

How to display custom field content on the AnQiCMS document detail page?

When managing website content in AnQiCMS, we often encounter the need to add some unique information for different types of documents (such as articles, products, etc.).AnQi CMS provides flexible content model features, allowing us to customize fields to meet these personalized needs.How can these custom fields be displayed on the document detail page of the website after they are created and filled with data? This is actually simpler than you imagine, AnQiCMS's powerful template tag system provides us with various convenient ways to achieve this.--- ###

2025-11-08

How to implement the display of previous and next document links in AnQiCMS templates?

When browsing website content, users often want to be able to navigate easily between related articles.In order to find more information or simply enjoy a smooth reading experience, the "Previous" and "Next" document links play a crucial role.They can not only effectively increase the user's stay time on the website, reduce the bounce rate, but also have a positive impact on the internal link structure of the website and the search engine optimization (SEO), helping search engines better understand the relevance of the website content.### Core Function Analysis: AnQiCMS

2025-11-08

How to use the AnQiCMS document list tag to display content for specific categories or recommended attributes?

In AnQi CMS, efficiently managing and displaying website content is the key to improving user experience and website operation effectiveness.Whether you want to display the latest articles of a specific category on the homepage or highlight products with the "recommended" attribute, the document list tag (`archiveList`) provided by AnQiCMS is the core tool to meet these needs.Its flexible parameter configuration allows us to accurately control content retrieval, transforming technical details into easily accessible operational strategies.

2025-11-08

How to display dynamic breadcrumb navigation in AnQiCMS and customize the home page name?

In website content management, breadcrumb navigation plays a crucial role.It not only helps visitors clearly understand their position on the website, provides a convenient path to return to the upper page, but also reflects the hierarchical structure of the website from the side, which is greatly beneficial to user experience and search engine optimization.AnQiCMS as a powerful content management system naturally provides a flexible way to manage and display this kind of navigation.

2025-11-08

How to use AnQiCMS tags to display the document list under a specific Tag?

In AnQiCMS, tags are a powerful content organization method that helps us associate content with different categories and models more flexibly.Using labels appropriately can not only optimize the SEO performance of a website, but also significantly improve the user's experience in discovering content on the website.When we want to focus on displaying all relevant documents under a specific tag, AnQiCMS provides a set of intuitive and efficient template tags to meet this need.This article will introduce in detail how to use the built-in template tags of AnQiCMS

2025-11-08

How to display user comment lists and implement pagination in AnQiCMS?

In website content operation, user comments are an important part of enhancing interactivity and activity, and reasonable pagination can ensure that the comment list is both complete and loads smoothly.AnQiCMS (AnQiCMS) provides powerful and flexible template tags, allowing you to easily display and manage user comments on the front-end page, and implement pagination functionality for the comment list.

2025-11-08

How to retrieve and display custom form fields in AnQiCMS comment form?

When using AnQiCMS to manage website content, the online message function is undoubtedly an important means of interacting with visitors, collecting feedback, or gathering potential customer information.In addition to the basic name, contact information, and message content, we often need to collect more specific and personalized information, such as 'Your project budget', 'The type of service you are interested in', or 'The expected contact time'.AnQi CMS provides a flexible custom message field function, allowing us to easily meet these needs.How can I retrieve and elegantly display these custom form fields on the website front page?

2025-11-08

How to display pagination links in AnQiCMS and control the number of page numbers displayed?

In website operation, effectively managing and displaying a large amount of content is the key to improving user experience.When the content list is too long, a reasonable pagination mechanism can not only make it easier for users to browse, but also optimize the page loading speed, and indirectly improve the search engine friendliness.In AnQiCMS, implementing pagination and flexibly controlling the display quantity of page numbers is a relatively direct and powerful process.--- ## Display pagination links elegantly and flexibly control the number of pages in AnQiCMS In your AnQiCMS website, when the number of articles, products, or other list content increases

2025-11-08