On the article detail page, how to obtain and display a list of recommended articles related to the current article?

Calendar 👁️ 61

In website content operation, increasing user stay time and reducing bounce rate is the goal pursued by every operator.After a user finishes reading an article, if they can immediately see other content that interests them, it will undoubtedly greatly enhance their engagement, thereby improving the overall interactivity and user experience of the website.And AnQiCMS (AnQiCMS) as a powerful content management system, provides us with convenient tools to implement intelligent recommendations for article detail pages without complex development work.

The list of recommended articles not only provides users with a deeper reading experience, guides them to browse more website content, reduces the website's bounce rate, but also greatly benefits the internal link structure and search engine optimization (SEO) of the website.A clear and reasonable internal link layout can help search engines better understand the relevance of website content, enhancing page authority. 幸运的是,AnQi CMS has fully considered the needs of content operation, its powerful template tag system is built-in with the function of retrieving related articles, allowing us to easily implement the intelligent recommendation of article detail pages without complex secondary development.

UtilizearchiveListTag-based recommendation of related articles

The core of Anqi CMS lies in its flexible template tags, among whicharchiveListtags are the main force for us to implement related article recommendations. On the article detail page, we can usearchiveListtags, with the help oftype="related"Parameters to get the recommended list related to the current article.

Whentypethe parameter torelatedThe system will intelligently recommend articles similar or of the same category as the current article based on the current article's classification, publication time, and other information.This is a default recommendation mechanism based on content proximity, simple and effective.

Below is a basic template code example showing how to introduce the recommended article list on the article detail page.

{# 在文章详情页,获取并展示相关文章列表 #}
<div class="related-articles">
    <h3>相关推荐</h3>
    <ul>
        {% archiveList archives with type="related" limit="5" %}
            {% 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>
                    </a>
                </li>
            {% empty %}
                <li>暂时没有相关推荐文章。</li>
            {% endfor %}
        {% endarchiveList %}
    </ul>
</div>

In this code block,archiveListTags are used to retrieve a list of articles namedarchives.type="related"Specified the type of related articles to be retrieved, whereaslimit="5"limits the number of recommended articles to 5. InforIn the loop, we can display the detailed information of each article byitem.Linkget the article link,item.TitleGet the article title,item.Thumbto retrieve article thumbnails,item.DescriptionGet the article description (and usetruncatechars:80the filter to extract the first 80 characters). If there are no relevant articles,emptythe content within the block will be displayed.

Use keywords to improve the accuracy of recommendations:like="keywords"

Sometimes relying solely on categorization and proximity is not enough to meet the need for more accurate recommendations. AnQi CMS provides more powerful...likeParameters allow us to intelligently match related content based on the keywords of the article. Just inarchiveListadd alike="keywords"The system will capture the current article's keywords and use them as a basis to find other articles containing similar keywords to recommend.

This means that carefully filling in keywords during article editing will directly affect the quality of recommendations.The more precise and rich the keywords are, the better the recommendation effect will naturally be.This requires content editors to pay attention to the filling of keywords when publishing articles.

Here is an example of template code using keywords for recommendation:

<div class="related-articles-by-keywords">
    <h3>按关键词推荐</h3>
    <ul>
        {% archiveList archives with type="related" like="keywords" limit="5" %}
            {% for item in archives %}
                <li>
                    <a href="{{ item.Link }}" title="{{ item.Title }}">
                        <h4>{{ item.Title }}</h4>
                        <p>{{ item.Description|truncatechars:80 }}</p>
                    </a>
                </li>
            {% empty %}
                <li>没有找到基于关键词的相关推荐。</li>
            {% endfor %}
        {% endarchiveList %}
    </ul>
</div>

As can be seen, compared to the previous code, it is just a simple change inarchiveListtag added.like="keywords"the parameters, and Anqi CMS can intelligently adjust the recommendation logic.

精细化management:manually associate recommended articleslike="relation"

In some cases, we may need stronger control, manually specifying which articles are related to the current article.For example, a series of articles, special reports, or recommendations made for specific marketing activities.The AnQi CMS also supports this flexible association method. In the article editing interface, we can directly set related articles (usually in the "Other parameters" or related articles/Tag tag setting area), and then through inarchiveListSet in the labellike="relation"Parameters, the system will prioritize displaying these articles manually associated by the content editor.

This approach gives the content operator the greatest freedom, ensuring that the recommended content fully conforms to the operational strategy.

The following is the implementation of manual association recommendation.

Related articles

How to control the article list to only display documents under the current category and not include content from its subcategories?

When managing website content in Anqi CMS, we usually organize articles into different categories to form a clear hierarchical structure.This structure provides great convenience when managing content in the background.However, when displaying the list of articles on the front-end page, we sometimes need to control the display range of content more accurately, for example, we only want to display the articles directly published under the current category, and not include the content of its subcategories.Luckyly, AnQi CMS provides a simple and powerful solution for this: using the `archiveList` template tag's `child`

2025-11-08

How to define a new field in a custom content model and flexibly call and display these fields on the front-end page?

In AnQi CMS, using a custom content model to manage and display personalized content is one of its core strengths.This allows us to flexibly create dedicated data structures for different types of content according to specific business requirements.This article will discuss in detail how to define these custom fields in the background, as well as how to cleverly call and display them on the frontend page. ### Define a new field in the backend content model The content model is like a "blueprint" for content, it determines what information each type of content (such as articles, products, cases, etc.) should include. To define a new field

2025-11-08

How can AnQi CMS display image watermarks or anti-crawling interference codes on the front end to protect original content?

In the current information explosion of the Internet environment, the value of original content is increasingly prominent.However, content plagiarism and malicious scraping have also become a major headache for many website operators, not only damaging the creators' labor results, but also possibly affecting the website's search engine rankings and brand reputation.Faced with this challenge, AnQiCMS (AnQiCMS) fully understands the importance of content protection, and is built-in with front-end image watermarking and anti-crawling interference code functions, aiming to provide a solid defense line for your original content.### Understand the necessity of content protection Before discussing specific features

2025-11-08

How to clearly display the user's input search keywords and related documents on the search results page?

In Anqi CMS, create a highly efficient and user-friendly search results page that can not only help visitors quickly find the information they need, but can also significantly improve the overall professionalism and conversion rate of the website.This article will delve into how to clearly display the search keywords and related documents entered by users under the powerful functions of AnQi CMS.Build a dedicated search page template: Clearly show user intent The template system of Anqi CMS is known for its high flexibility, allowing you to customize each page according to your business needs.The search results page usually corresponds to the current template directory under

2025-11-08

How to retrieve and display the global settings information of a website, such as the website name, Logo, and filing number in the template?

When building website templates in AnQiCMS, we often need to display some general information at the website level, such as the name of the website, Logo image, and legal filing number required by law.This information is usually managed in the background global settings to ensure consistency across the entire site and ease of maintenance.AnQiCMS has a powerful template tag system, especially the `system` tag, which makes it very intuitive and efficient to obtain and display these global settings in the template.### Understanding Global Settings and `system`

2025-11-08

How to obtain and display the contact information configured on the back-end, such as phone numbers, email addresses, WeChat QR codes, and other diversified information?

AnQiCMS (AnQiCMS) is an efficient and flexible content management system that excels in helping enterprises display their brand image and provide convenient communication channels.For any website, having clear and easily accessible contact information is crucial for building trust with users and promoting cooperation.AnQi CMS deeply understands this, providing a set of intuitive and powerful functions that allow you to easily manage and display various contact information such as phone numbers, email addresses, WeChat QR codes, etc.### Backend Configuration: Central Management Center for Contact Information In AnQi CMS

2025-11-08

How to use the article's `flag` attribute (such as 'Top Story', 'Recommendation') to filter and highlight specific content?

In AnQi CMS, efficiently managing and highlighting specific content is the key to website operation success.When the content of the website becomes increasingly rich, how to ensure that important information can quickly attract the attention of visitors and guide them to browse the core content, which has become a problem that every operator needs to think deeply about.The Anqi CMS provides a powerful "recommendation attribute" (flag) feature that allows you to easily filter and highlight specific content, thereby enhancing user experience and website operation effects.### Understanding the `flag` attribute of Anqi CMS The `flag` attribute, as the name suggests

2025-11-08

How to receive and display custom form fields from the backend in a frontend comment form?

In website operation, the message form is an important channel for interacting with users, collecting feedback and leads.AnQiCMS provides flexible comment functions, one very practical ability is to allow us to customize form fields in the background, and seamlessly present them in the front-end comment form to meet the personalized information collection needs of different business scenarios.Next, we will discuss in detail how to implement this feature in Anqi CMS.### One, define the custom message field in the background First, we need to enter the Anqi CMS backend management interface

2025-11-08