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.