In website content operation, the goal pursued by each operator is to increase user stay time and reduce the bounce rate.When users finish reading an article, if they can immediately see other content that interests them, it will undoubtedly greatly enhance their sense of participation, thereby improving the overall interactivity and user experience of the website.And 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 recommended article list not only provides users with a deeper reading experience, guides them to browse more website content, and reduce the website's bounce rate, but also greatly benefits the internal link structure and search engine optimization (SEO) of the website.An clear and reasonable internal link layout can help search engines better understand the relevance of website content and enhance page authority.It is fortunate that AnQi CMS fully considers the needs of content operation, with its powerful template tag system built-in the function of retrieving related articles, allowing us to easily achieve 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, wherearchiveListtags are our main force in article recommendation. On the article detail page, we can utilizearchiveListtags, withtype="related"Parameters, to get the recommended list of articles related to the current article.
Whentypeparameter settingsrelatedWhen, the system will intelligently recommend articles similar or of the same category as the current article based on the classification, publishing time and other information of the current article.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,archiveListTags are used to get a list of articles namedarchives.type="related"Specify the type of related articles to be retrieved, whilelimit="5"limits the number of recommended articles to 5. In theforloop, we can go throughitem.LinkGet article link,item.TitleTo get the article title,item.ThumbGet article thumbnail,item.DescriptionGet article description (and use),truncatechars:80Filter to extract the first 80 characters). If there are no related articles,emptythe content within the block will be displayed.
Use keywords to improve recommendation accuracy:like="keywords"
仅仅依靠分类和临近性有时不足以满足更精准的推荐需求。安企CMS为此提供了更强大的EnglishlikeParameters allow us to intelligently match related content based on the keywords of the article. Just addarchiveListtags inlike="keywords"The system will capture the current article's keywords and use them as a basis to find other articles containing similar or related keywords for recommendation.
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, in addition to the main content.
The following is an example of template code for recommendation using keywords:
<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>
It can be seen that compared to the previous code, it only adds simple things in thearchiveListtagslike="keywords"Parameters, the CMS can intelligently adjust the recommendation logic.
Fine-grained management: Manually associate recommended articles.like="relation"
In some scenarios, we may need stronger control, manually specifying which articles are related to the current article.For example, series articles, special reports, or recommendations for specific marketing activities.The AnQi CMS also supports this flexible association method.archiveListsetting in the labellike="relation"Parameters, the system will prioritize displaying these articles manually associated by the content editor.
This way gives the content operator the greatest degree of freedom, ensuring that the recommended content fully conforms to the operation strategy.
The following is to implement manual association recommendation.