How does AnQi CMS display related article lists based on keywords or relevance?

In content management and website operation, how to effectively improve user experience, extend the visitor's stay on the site, and optimize the search engine crawling efficiency is a key concern for every operator.Among them, displaying highly relevant recommended content with the current article is undoubtedly an effective method.AnQiCMS as an efficient content management system fully considers this requirement and provides flexible and powerful functions to easily achieve this goal.

Core function analysis:archiveListThe clever use of tags

AnQiCMS provides powerful template tags that allow you to build complex page structures and data displays without delving into programming. When implementing the feature of related article lists,archiveListTags are your core weapon. It can not only list the regular article list, but also intelligently filter and display the content highly related to the current article through its unique parameter configuration.

The key to implementing the list of related articles isarchiveListin the labeltype="related"The parameter. When you use this parameter on the article detail page, AnQiCMS will automatically identify the current article and recommend other articles based on the association logic you set.

Understand the association logic: keywords and manual settings

AnQiCMS provides two main association logic methods to determine which articles are 'related':

Method one: Smart association based on keywords

AnQiCMS can intelligently find other articles with similar themes based on the keywords and Tag tags set in the article.This method utilizes the intrinsic connection of the content, the recommended results are usually more in line with the reader's interests.

To enable smart association based on keywords, you need toarchiveListUsed in tagslike="keywords"Parameters. The system will match and recommend similar articles based on the keywords and Tag information of the current article.

To make this intelligent association more accurate, it is recommended that you make full use of the 'Document Keywords' and 'Tag Tags' functions in the background when publishing content.Add precise and rich keywords and tags to each article, as this not only helps with the recommendation of related articles, but also is an important means to improve SEO effectiveness.

Code example: Recommend relevant articles based on keywords

{# 假设这是文章详情页的模板,此代码块将显示基于关键词推荐的5篇文章 #}
<div class="related-articles">
    <h2>相关推荐</h2>
    <ul>
    {% archiveList relatedArticles with type="related" like="keywords" limit="5" %}
        {% for item in relatedArticles %}
        <li>
            <a href="{{item.Link}}" title="{{item.Title}}">
                {% if item.Thumb %}<img src="{{item.Thumb}}" alt="{{item.Title}}" class="article-thumb">{% endif %}
                <h3>{{item.Title}}</h3>
                <p class="description">{{item.Description|truncatechars:80}}</p>
                <div class="meta">
                    <span>{{stampToDate(item.CreatedTime, "2006-01-02")}}</span>
                    <span>{{item.Views}} 阅读</span>
                </div>
            </a>
        </li>
        {% empty %}
        <li>暂无相关推荐。</li>
        {% endfor %}
    {% endarchiveList %}
    </ul>
</div>

Method two: Edit carefully planned manual associations

Under certain specific scenarios, you may want to more accurately control which articles should be associated with each other, for example, if you are promoting a product series or need to guide users to read a specific content path.AnQiCMS also provides this flexibility, allowing you to manually select related articles in the background article editing interface.

When you want the system to only display the articles you manually selected or associated in the article detail page on the backend, you can usearchiveListlabel'slike="relation"Parameters. This method ensures the absolute accuracy of the recommended content, fully in line with your operational intent.

Code example: recommend related articles based on manual association.

{# 假设这是文章详情页的模板,此代码块将显示手动关联的3篇文章 #}
<div class="manual-related-articles">
    <h2>精选推荐</h2>
    <ul>
    {% archiveList handpickedArticles with type="related" like="relation" limit="3" %}
        {% for item in handpickedArticles %}
        <li>
            <a href="{{item.Link}}" title="{{item.Title}}">
                {% if item.Logo %}<img src="{{item.Logo}}" alt="{{item.Title}}" class="article-logo">{% endif %}
                <h4>{{item.Title}}</h4>
                <p class="meta">分类:{% categoryDetail with name="Title" id=item.CategoryId %}</p>
            </a>
        </li>
        {% empty %}
        <li>暂无精选推荐。</li>
        {% endfor %}
    {% endarchiveList %}
    </ul>
</div>

Flexible application: Customize related article list

In addition to the two core association methods mentioned above,archiveListTags also provide various parameters to help you finely control the display of related article lists:

  • limit: Control the display quantity. You can setlimit="5"to display 5 articles, orlimit="3,7"to start displaying 7 articles from the 3rd one.
  • moduleId: Limit recommended content from a specific content model. For example,moduleId="1"Only show related content under the "Article" model.
  • categoryId: Limit recommended content to a specific category. For example,categoryId="10"Only display articles related to the current article and belong to the category with ID 10.
  • excludeCategoryId: Exclude certain categories of articles. If you do not want certain categories of articles to appear in related lists, you can use this parameter.
  • flagBased on the recommended attributes of the article (such as headline, recommended, slideshow, etc.) for filtering. For example,flag="c"Only show articles marked as 'recommended'.
  • order: Adjust the sorting method of related articles. Althoughtype="related"It has its internal sorting logic by default, but you can also try to useorder="views desc"Sort by view count in reverse order, ororder="id desc"Sort by the most recent release.

By combining these parameters, you can create highly customized, more attractive related article lists according to the actual needs and content operation strategy of the website.

Summary

AnQiCMS through its powerfularchiveListLabel and flexible parameter configuration, providing you with multiple ways to display related article lists.Whether it is based on the intelligent keyword matching of the system or through manual settings for precise recommendation, it can effectively enhance the content depth and user engagement of the website.Make good use of these features, and it will make your website content more vibrant and easier to gain the favor of search engines.


Frequently Asked Questions (FAQ)

Q1: Why is the related article list not displayed on my article detail page?

A1: Please check the following points:

  1. Is the template code correct?Make sure you have already setarchiveListwith the tag andtype="related"Parameters added to the article detail page template and there are no syntax errors.
  2. Article Keywords/Tag:If you are usinglike="keywords"Please confirm whether the article itself has set keywords or Tags, and whether there are other articles associated with these keywords/Tags.
  3. Manual association setup:If you are usinglike="relation"Please check if you manually associated other articles while editing the current article in the background.
  4. Number of contents:Make sure your website has enough content so that the system can find enough relevant articles to recommend.

Q2:like="keywords"How is the similarity of articles judged?

A2: When you uselike="keywords"When a parameter is set, AnQiCMS will first obtain the "document keywords" and "Tag tags" set in the current article. Then, it will search for other articles containing these keywords or tags in the entire content library, and sort them according to factors such as match degree, publishing time, and so on, finally