How to display a list of recommended content related to the current article?

Calendar 👁️ 67

In content operation, guiding users to discover more interesting content is one of the key strategies to improve user experience and extend the time spent on the website.AnQiCMS provides very flexible and powerful functions to help us easily achieve the goal of displaying a list of recommended content related to the current article.

Why do you need related recommended content?

Imagine a reader immersed in an exquisitely written article. If they can smoothly discover more content closely related to the current topic and equally精彩, it will undoubtedly greatly enhance their browsing experience.This not only increases the PV (page views) of the website and effectively reduces the bounce rate, but also enhances the search engine's ability to crawl and understand the website's content by building a dense internal link network, thereby optimizing the SEO performance.

Implement the core mechanism of related recommendation in AnQi CMS

AnQi CMS provides a very convenient feature to achieve this, that is, by using its powerfularchiveListTemplate tag. This tag is used to obtain various document lists as a '万能钥匙', by pairing different parameters, we can achieve various content display needs, including related recommendations.

To display recommended content related to the current article, we mainly usearchiveListlabel'stype="related"The parameter tells the system that we want to obtain a list of recommended items related to the content of the article we are currently browsing.

The system receivestype="related"After the command, it will intelligently match the closest other articles based on the category, tags, and content similarity of the current article.This automatic matching mechanism usually provides good recommendation effects, as it can identify similar topics that users may be interested in.

How to control the relevant recommendations more accurately?

If you wish to control related recommendations more accurately,archiveListthe tags also providelikethe parameter can further refine the recommendation logic:

  1. Keyword-based recommendation (like="keywords")If the current article is set with keywords, the system will search for other articles containing the same keywords throughout the entire site.This is very effective for articles with clear topic tags or keywords, ensuring the tightness of recommended content.{% archiveList archives with type="related" like="keywords" limit="5" %}

  2. Manual association recommendation based on backend (like="relation")For particularly important articles, you may want to have full control over the recommended content. Anqi CMS allows you to manually associate specified articles in the article editing background. When you uselike="relation"When the parameter is set, the system will only display the recommended content you manually associated, ensuring the accuracy of recommendations and operational flexibility. For example:{% archiveList archives with type="related" like="relation" limit="5" %}

Application: Display related recommendations on the article detail page

We usually place related recommended content at the bottom of the article detail page or in the sidebar area.These positions do not disturb the main content reading and can provide extended reading opportunities in a timely manner.

This is an example of a template code that displays 5 related recommended articles at the bottom of an article detail page:

{# related 相关文档列表展示 #}
<div class="related-articles">
    <h3>相关推荐</h3>
    <ul>
    {% archiveList archives with type="related" limit="5" %} {# 设置最多显示5篇相关文章 #}
        {% for item in archives %}
        <li>
            <a href="{{item.Link}}">
                <img src="{{item.Thumb}}" alt="{{item.Title}}" class="article-thumb"> {# 假设item.Thumb是文章缩略图 #}
                <h4>{{item.Title}}</h4>
                <p>{{item.Description|truncatechars:80}}</p> {# 截取文章描述的前80个字符 #}
                <time>{{stampToDate(item.CreatedTime, "2006-01-02")}}</time> {# 格式化文章发布日期 #}
            </a>
        </li>
        {% empty %}
        <li>暂无相关推荐内容。</li> {# 如果没有相关内容,显示此提示 #}
        {% endfor %}
    {% endarchiveList %}
    </ul>
</div>

Code explanation:

  • {% archiveList archives with type="related" limit="5" %}: This is a core tag that indicates the system to retrieve the list of related documents and assign the result toarchivesVariables, limited to display at most 5 articles.
  • {% for item in archives %}: Loop through each related article obtained.
  • {{item.Link}}: Output the article link address.
  • {{item.Thumb}}The thumbnail URL of the article (if the article has a thumbnail).
  • {{item.Title}}The title of the article.
  • {{item.Description|truncatechars:80}}The introduction of the article, and usetruncatecharsThe filter truncates it to a maximum of 80 characters to prevent the description from being too long and affecting the layout.
  • {{stampToDate(item.CreatedTime, "2006-01-02")}}: The creation timestamp of the article is formatted to the date format of "Year-Month-Day".
  • {% empty %}This is a very friendly usage, whenarchivesThe list is empty (i.e., no relevant articles are found) and will display<li>暂无相关推荐内容。</li>To avoid blank pages or errors on the page."),

Optimization suggestions and **practice

  1. Reasonably set the display quantity:BylimitThe parameter controls the number of recommended contents. Generally speaking, a range of 5 to 8 articles is appropriate, as it provides enough choices without making the page too long.
  2. Pay attention to visual attractiveness:Match the article thumbnail{{item.Thumb}}Or the featured image{{item.Logo}}It can significantly increase click-through rate. A clear, attractive image is more likely to stimulate readers' desire to click than plain text.
  3. Improve content relevance:Ensure that the categories, tags, and keywords are set accurately and representatively when the article is published. High-quality metadata is the foundation of the system's intelligent recommendation.
  4. Use manual association:For articles or content you want to highlight on the website, it is recommended to manually associate them using the 'related documents' feature in the background.This ensures that the user is directed to the next step you carefully plan while reading the core content.

With these flexible configurations and practical template tags, AnQi CMS can help you easily build a website with more interactivity and user stickiness, allowing every visitor to freely navigate through your content ocean.


Frequently Asked Questions (FAQ)

1. How can I check if my recommended content is not displayed or the number of displayed items is incorrect?First, check that your article content is sufficient and that there are enough articles that belong to the same category or have similar tags/keywords as the current article. Second, make sure that the template code inarchiveListlabel'slimitParameter settings are reasonable, for examplelimit="5". If you have setlike="relation"Please check if the article backend has manually associated with other articles.Finally, check if the article has a thumbnail or abstract. If the template calls for it and the content is missing, it may cause display errors.

2. Can I make the recommended content not limited to the same category?Of course. Anqi CMS'sarchiveListThe tag is intype="related"In this mode, it will prioritize articles in the same category by default, but its intelligent matching mechanism will also refer to tags and keywords. If you want to break the category restriction, you can try toarchiveListUse explicitlylike="keywords"Parameters. This way, the system will be more focused on

Related articles

How to display the link to the previous and next article on the Anqi CMS content page?

In AnQi CMS, it is a common need to add navigation links for "Previous Article" and "Next Article" to enhance the user experience of the website and the efficiency of internal links.These links not only help visitors browse related content more smoothly, but also have a positive impact on the website's SEO performance.AnQi CMS provides a set of intuitive template tags that allow you to easily display these navigation features on the content detail page.### Core Function: Use `prevArchive` and `nextArchive` tags Anqi CMS passes through

2025-11-08

What tags does Anqi CMS provide to display content publishing or update time information?

In website content operation, the time of content release and update is a key factor in conveying information timeliness and establishing user trust.For search engine optimization (SEO), clear time information also helps improve the freshness score of the content.Anqi CMS is well-versed in this, providing users with flexible and diverse tags and methods to accurately and beautifully display these time information on the website front-end.Next, we will explore how Anqi CMS helps us manage and display the content publication and update time.###

2025-11-08

How to judge conditions in templates and dynamically display different content blocks based on logic?

In AnQiCMS, flexibly controlling the display of web page content is the key to website operators creating personalized, high-efficiency websites.The AnQiCMS template engine provides rich logical judgment and dynamic content display capabilities, allowing us to present content intelligently according to different conditions, greatly enhancing user experience and website adaptability.AnQiCMS' template syntax is clever, it absorbs the advantages of the Django template engine while also taking into account the characteristics of the Go language.

2025-11-08

How to use the pseudo-static function of Anqi CMS to optimize the display structure of URLs and improve SEO effects?

In website operation, the structure of URL (Uniform Resource Locator) has a significant impact on the SEO performance of the website.A clear, concise, and meaningful URL not only improves user experience but also helps search engines better understand and crawl web content.AnQiCMS (AnQiCMS) is well-versed in this field, providing powerful static URL features to help us easily optimize the display structure of URLs, thereby significantly enhancing SEO effects.

2025-11-08

How does Anqi CMS display and manage website friend links?

In website operation, friendship links play an important role. They not only help to improve the website's search engine ranking (SEO), but also bring valuable traffic, and are also a manifestation of cooperation and mutual trust between websites.Anqi CMS is well-versed in this, providing website operators with a直观 and efficient buddy link management and display solution, allowing you to easily master this feature.Next, we will delve into how to manage friend links in the background, to how to flexibly display them on the website frontend, and provide you with a detailed explanation of the friend links feature of Anqi CMS.

2025-11-08

How to display the list of user comments on articles in AnQi CMS?

In AnQi CMS, allowing users to comment on articles and clearly displaying these comments is an important aspect of enhancing the interactivity and user engagement of the website.AnQiCMS's powerful template engine and built-in features make this process flexible and efficient.This article will introduce in detail how to integrate the comment list and its related functions on the article detail page.

2025-11-08

How to build and display a custom field comment form on the front-end page?

When you want website visitors to be able to interact with you, such as submitting questions, providing feedback, or making appointments, a well-functioning contact form is essential.AnQiCMS provides a very flexible and powerful message management function, the core of which is to support custom message fields, allowing you to build personalized forms according to your actual business needs.This article will guide you on how to build and display these comment forms with custom fields on the front-end page.Why do you need a custom message form?

2025-11-08

How to display system-level configurations such as the website logo, filing number, copyright information, etc.

The brand identity, legal statements, and core contact information, such as Logo, filing number, and copyright information, are an indispensable part of the professional image of a website.They not only convey trust and standardization to visitors, but are also important aspects of search engine optimization and legal compliance.In Anqi CMS, managing and displaying these system-level configurations becomes extremely intuitive and efficient. ### Backend Settings: The "Control Center" of Website Information AnQi CMS concentrates these core website information in the "Global Settings" of the backend, making management clear at a glance.

2025-11-08