How to let visitors easily find more related content after reading an excellent article on your website, so that they can continue to explore your site. This is not only a key strategy to significantly improve user experience, but also to optimize website SEO and reduce the bounce rate.AnQiCMS (AnQiCMS) provides powerful and flexible functions, allowing you to easily configure and display related articles on the article detail page and specify relevance rules according to actual needs.

Next, we will together learn how to achieve this goal in the Anqi CMS.

Understand the value of the related articles list

Imagine that when a user is interested in a topic and finishes reading a deep article, if they can immediately see several recommended articles that are related in content and equally engaging, they are likely to continue reading instead of closing the page.This seamless reading experience can not only extend the user's stay on your website and increase the number of page views, but also enhance the overall weight and keyword ranking of the website by passing the relevance between pages to search engines through the construction of internal links.Security CMS precisely grasps this core value, providing you with an intuitive and efficient solution.

Display the related articles list on the article detail page

To display related articles on the article detail page, we first need to edit the corresponding content template. According to the template design conventions of Anqi CMS, the article detail page usually corresponds to thetemplate/{您的模板目录}/{模型table}/detail.htmlfile. In this template file, you can use built-inarchiveListtags to retrieve and display related articles.

For example, the most basic related article list code may look like this:

<section class="related-articles">
    <h3>相关文章推荐</h3>
    <ul>
        {% archiveList relatedArticles with type="related" limit="5" %}
            {% for item in relatedArticles %}
                <li><a href="{{item.Link}}">{{item.Title}}</a></li>
            {% empty %}
                <li>暂时没有找到更多相关文章。</li>
            {% endfor %}
        {% endarchiveList %}
    </ul>
</section>

This code will default fetch 5 pieces of content related to the current article.type="related"This is the key parameter we need to get the list of relevant articles. If there is no matching relevant content on the current page of articles,{% empty %}The text in the label will be displayed, avoiding blank pages.

Specify relevance rules: automatic matching and precise control

Anqi CMS'sarchiveListLabels not only support default relevance matching, but also provide more detailed rules, allowing you to flexibly configure according to your actual operational strategy.

1. Intelligent matching based on keywords

When you want the system to automatically recommend related articles based on keywords in the article content, you can uselike="keywords"This parameter is suitable for websites with large amounts of content and comprehensive keyword coverage, enabling highly automated recommendations for related articles.

To enable keyword matching, you need to make sure that the "Document Keywords" field is correctly filled in when the article is published in the background. In the Anqi CMS backend, when editing or publishing articles, find the "Document Keywords" input box, and enter keywords highly relevant to the content of the article here. Please use English commas to separate multiple keywords.,Perform separation. The system will intelligently search for other related articles based on these keywords.

In the template, you can adjust it like this.archiveListTags:

<section class="related-articles">
    <h3>根据关键词为您推荐</h3>
    <ul>
        {% archiveList relatedArticles with type="related" like="keywords" limit="5" %}
            {% for item in relatedArticles %}
                <li><a href="{{item.Link}}">{{item.Title}}</a></li>
            {% empty %}
                <li>暂时没有找到更多相关文章。</li>
            {% endfor %}
        {% endarchiveList %}
    </ul>
</section>

Thus, the system will intelligently match and display related articles based on the keywords of the current article.

2. Precise association set manually.

In certain specific scenarios, you may need to make very precise association recommendations for some articles, for example, to guide users to read specific articles in a series or to promote a core product.This CMS provides the function to manually set related articles.like="relation"Parameters, you can configure the list to only display associated articles explicitly specified in the article editing interface.

In the AnQi CMS backend, when you edit an article, you can find the configuration option for "related documents" in the "other parameters" or "more model custom fields" section. The specific name may vary depending on your content model customization.Here, you can manually select or enter other articles you want to associate with the current article.

In the template, you can use it like this:archiveListTags:

<section class="related-articles">
    <h3>编辑精选相关推荐</h3>
    <ul>
        {% archiveList relatedArticles with type="related" like="relation" limit="3" %}
            {% for item in relatedArticles %}
                <li><a href="{{item.Link}}">{{item.Title}}</a></li>
            {% empty %}
                <li>没有手动设置的精选相关文章。</li>
            {% endfor %}
        {% endarchiveList %}
    </ul>
</section>

Through this method, you can fully control which articles will be recommended on the current page, achieving the most accurate content marketing and user guidance.

Advanced Optimization and Precautions

  • Quantity control: limitThe parameter is very useful. You can flexibly adjust the number of articles displayed according to the page layout and importance. For example, you can display more at the bottom of the article and fewer in the sidebar.
  • Layout and Style:The list of related articles is usually placed at the bottom of the article content, or as a module in the sidebar.<section>or<div>Add appropriate CSS classes to the tag and beautify it through the stylesheet to keep it consistent with the overall design style of your website, enhancing the visual appeal.
  • Combined use:You can even use multiple relevance rules on the same article detail page to display different lists of related articles, for example, one list showing articles matched automatically by keywords, and another list displaying articles handpicked by editors.
  • SEO benefits:A well-recommended article system, helpful to build a strong in-site link network, guiding search engine spiders to more deeply crawl the website content, and enhancing the SEO value of all relevant pages.

Through these flexible configurations provided by the Anqi CMS, you can easily create an intelligent and efficient related article recommendation system. It not only optimizes the user reading experience but also brings real operational benefits to your website.


Common Questions (FAQ)

Q1: If the article does not have any keywords set,like="keywords"the list of related articles will still be displayed?A1: If the article does not have any keywords set,like="keywords"The rules may not be able to effectively match related articles because the system lacks a matching basis. In this case, the list is likely to display{% empty %}Tag content. To ensure the effectiveness of recommendations, it is recommended that you fill in relevant keywords when publishing articles.

Q2: How to manually set the 'related documents' configuration of the related articles?

Q3:archiveListWhat is the default sorting rule for 'related articles' of tags?A3: When you do not specifylikewhentype="related"The system will automatically retrieve similar or closely related documents within the same category based on the current article's ID.The specific sorting logic usually prioritizes the latest released or highly viewed articles within the same category to ensure the timeliness and popularity of the recommendations.