How to display a list of recommended articles related to the current article content, supporting keyword search or manual association?

Calendar 👁️ 73

As an experienced security CMS website operations personnel, I fully understand the importance of high-quality content and accurate recommendations for improving user experience and website SEO.In the article detail page, effectively display recommended articles related to the current content, which can not only extend the user's visit time and reduce the bounce rate, but also optimize and improve the page weight and crawling efficiency through internal links.AnQi CMS provides flexible tags, supporting us to build this recommendation list through keywords or manual methods.

Implementing related article recommendations in Anqi CMS

AnQi CMS enables powerful template tag systems, especiallyarchiveListtags, providing us with a powerful tool for implementing related article recommendations. In the article detail page, we can usetype="related"Parameters to call the recommendation list related to the current article content. This tag has the ability to automatically associate with intelligence, and also supports our fine-grained manual control.

Article recommendations based on keyword association

By default, when we use the article detail pagearchiveListtags and settype="related"At the moment, Anqicms will intelligently capture and recommend other articles closest in content to the current article based on its category, tags, and content similarity.This approach is particularly efficient for websites with a large amount of content and similar article topics, as it can automatically complete most of the association work, greatly reducing the burden of manual maintenance.

If we need to use keywords more accurately for automatic association, we canarchiveListSpecify further in the taglike="keywords"Parameters. This means that the system will match other articles' keywords based on the current article's keywords, thereby filtering out more relevant recommended content.This method requires us to ensure the accuracy and richness of keywords when publishing articles, so that the automatic recommendation effect will be better.For example, if the current article discusses “AnQi CMS template creation”, the system will recommend articles containing keywords such as “template creation”, “AnQi CMS development”, and so on.

Manually associate recommended articles to enhance control

In addition to automatic association, Anqi CMS also provides the option to manually associate recommended articles, which means that our operation personnel have greater control over the recommended content.When there is a strong correlation between certain specific articles, or when we want to promote certain specific content, manual association becomes particularly important.

To manually associate, we need toarchiveListSet in the labeltype="related"while also increasinglike="relation"The parameter tells the system to read the list of preset related documents in the article background editing interface.In the Anqi CMS backend, when we edit a document, we are usually able to find a field in the 'Other Parameters' or a dedicated 'Related Documents' settings area that allows us to manually select or enter other articles associated with the current article.By precisely configuring these manually associated article IDs or titles, we can ensure that the content we want users to see is displayed on the article detail page, whether it is a series of articles, important announcements, or promotional products.

The following is an example of code that displays a list of related articles in an Anqi CMS template, which combines the logic of keyword automatic association and manual association:

{# 假设这是文章详情页,archive变量已包含当前文章数据 #}

<section class="related-articles">
    <h2>相关推荐</h2>
    <ul>
        {# 尝试首先通过手动关联来获取推荐文章,如果后台有设置 #}
        {% archiveList manualRelations with type="related" like="relation" limit="5" %}
            {% for item in manualRelations %}
                <li>
                    <a href="{{ item.Link }}">
                        {% if item.Thumb %}<img src="{{ item.Thumb }}" alt="{{ item.Title }}"/>{% endif %}
                        <h3>{{ item.Title }}</h3>
                        <p>{{ item.Description|truncatechars:80 }}</p>
                    </a>
                </li>
            {% endfor %}
        {% endarchiveList %}

        {# 如果手动关联文章不足或没有设置,则通过关键词自动获取 #}
        {% archiveList keywordRelations with type="related" like="keywords" limit="5" %}
            {% for item in keywordRelations %}
                <li>
                    <a href="{{ item.Link }}">
                        {% if item.Thumb %}<img src="{{ item.Thumb }}" alt="{{ item.Title }}"/>{% endif %}
                        <h3>{{ item.Title }}</h3>
                        <p>{{ item.Description|truncatechars:80 }}</p>
                    </a>
                </li>
            {% endfor %}
        {% endarchiveList %}

        {# 如果上述两种方式都未能提供足够内容,可以退而求其次,获取同分类最新文章 #}
        {% archiveList fallbackArticles with categoryId=archive.CategoryId type="list" order="id desc" limit="5" %}
            {% for item in fallbackArticles %}
                {# 排除当前文章本身 #}
                {% if item.Id != archive.Id %}
                    <li>
                        <a href="{{ item.Link }}">
                            {% if item.Thumb %}<img src="{{ item.Thumb }}" alt="{{ item.Title }}"/>{% endif %}
                            <h3>{{ item.Title }}</h3>
                            <p>{{ item.Description|truncatechars:80 }}</p>
                        </a>
                    </li>
                {% endif %}
            {% endfor %}
        {% endarchiveList %}
    </ul>
</section>

In the operation, reasonably using the relevant article recommendation list can significantly improve user activity on the website.It is recommended that we prioritize manual association to ensure the exposure of core content, and then use keyword automatic association to cover a wider range of related topics.At the same time, regularly reviewing the effectiveness of recommendations and adjusting the association strategy based on user behavior data will help to continuously optimize the user experience and the effectiveness of content marketing.

Frequently Asked Questions (FAQ)

Why is my related article list not displaying any content?

If the related article list is empty, first check if the current article is on the detail page (archiveDetailcontext) becausetype="related"The tag only takes effect on this type of page. Next, confirm whether the article has been published and is visible. If usinglike="keywords",please check if the article has set keywords; if usinglike="relation"Please confirm whether other articles have been manually associated in the background article editing page. Finally, ensure that the spelling and parameter settings of the template tags are correct.

Can I mix the automatic association of keywords with manual association?

Yes, you can mix and match. In the template, you can first try to associate articles manually, and if the number is insufficient, supplement them through keyword automatic association.As shown in the code example above, by nesting or conditional judgment, you can flexibly control the priority and source of recommended content to achieve **user experience and operation goals.

What is the sorting logic of related articles? Can I control its sorting?

When usingtype="related"When, the default sorting logic is based on the system's intelligent judgment of relevance. However,archiveListThe tag itself supportsorderparameters, for exampleorder="views desc"(in descending order of views) ororder="id desc"(in descending order of publication time). You can try to adjust theorderThe parameter withtype="related"Combine usage, but please note that for certain types of relevance calculations (such aslike="relation"Or the default nearest document), the sorting effect may be limited by the internal logic. **In practice, the system first filters based on relevance and then applies your sorting preferences on this basis.

Related articles

How to get the title, link, and thumbnail of the previous and next articles of the current article?

As an experienced website manager familiar with the operation of Anqi CMS, I fully understand the importance of the details of content presentation to user experience and the overall performance of the website.The front and rear navigation function of the article detail page can not only effectively guide users to continue browsing and reduce the bounce rate, but also is an effective means to enhance the relevance between pages and optimize the internal link structure.An enterprise CMS provides a concise and efficient template tag, allowing us to easily achieve this function.--- ### Enhance Content Coherence: Implement Previous and Next Article Navigation in AnQiCMS In Website Content Operation

2025-11-06

How to implement complete pagination functionality for the article list in AnQiCMS template?

As an expert deeply familiar with the operation of AnQiCMS, I know that a smooth, user-friendly website experience is crucial for attracting and retaining users.The pagination feature of a content list is the cornerstone of any content-intensive website, not only optimizing the user's browsing experience, but also an important aspect of search engine optimization.In AnQiCMS, achieving complete pagination for the article list is efficient and flexible through its powerful template tag system.

2025-11-06

How to use the `archiveList` tag to get the article list and support sorting by ID, views, or custom sorting?

As an experienced CMS website operation person, I know that efficient content management is crucial for attracting and retaining users.The template tag system provided by AnQi CMS is its strong point, among which the `archiveList` tag is the core of daily content display.It can help us flexibly extract articles, products, and other content from the database and sort and display them in the way we want.

2025-11-06

How to get the list of all single pages or the detailed content of a specific single page in AnQiCMS template?

As a senior security CMS website operator, I am well aware of the importance of high-quality, well-structured content for website user experience and search engine optimization.A single page is the core of a website's basic information display, such as "About Us", "Contact Information", and "Terms of Service", etc.In AnQiCMS, through the powerful template tag system, we can flexibly obtain and display the content of these single pages. I will elaborate in detail on how to obtain the list of all single pages and the detailed content of a specific single page in the AnQiCMS template.###

2025-11-06

How to retrieve and display the custom parameter field value of the article through template tags in AnQiCMS?

In AnQiCMS (AnQiCMS), the custom parameter field provides great flexibility and scalability for website content.As a website operator familiar with AnQi CMS, I am well aware of how to effectively utilize these fields and display them on the website front end to meet diverse content display needs.This article will elaborate on how to use the AnQi CMS template tags to obtain and display the custom parameter field values of the article.### Understanding the customized parameter fields of AnQi CMS AnQi CMS allows users to customize the content model according to business needs

2025-11-06

How to build a list page of articles with filtering conditions, such as filtering by custom properties?

As an experienced CMS website operation personnel of an enterprise, I know how to meet user needs through refined content presentation.Build a list page of articles with filtering conditions, especially on custom attributes, is an important means to enhance user experience and help users quickly find the information they need.AnQi CMS, with its flexible content model and powerful template tags, makes this process efficient and intuitive.Build a list page of articles filtered by custom attributes, mainly involving the following core stages: first, define and configure these custom attributes in the background management system; next,

2025-11-06

How to display the Tag list of articles in AnQiCMS template and generate links for each Tag?

The generation and display of article Tag list and its links in AnQiCMS template As a website operator who deeply understands the operation of AnQiCMS and has a profound understanding of content operation, I know that article tags (Tags) play a core role in improving content discoverability, optimizing user experience, and strengthening website SEO.Tags can not only help readers find related content quickly, but also provide more rich semantic information for search engines.This article will detail how to efficiently display the tag list in AnQiCMS templates

2025-11-06

How to get the detailed information of a specific Tag, such as Tag name, description, index letter, and Logo?

As an experienced CMS website operator, I am well aware of the importance of content tags (Tags) in website content management and SEO optimization.They can not only help us organize content more flexibly and improve user experience, but are also one of the key factors for search engines to understand the structure of website content.Today, I will delve deeply into how to obtain and display detailed information of specific tags in the Anqi CMS template, including tag names, descriptions, index letters, and Logos, to achieve a more refined front-end display.###

2025-11-06