How to effectively attract visitors, extend their stay on the website, and guide them to discover more interesting content is a crucial issue in content management and website operations.AutoCMS (AutoCMS) provides a powerful and flexible mechanism that helps us easily display a list of recommended contents on the current article page, thus greatly enhancing user experience and the overall performance of the website.
Core Mechanism:archiveListTagstype="related"Property
The most direct and effective way to implement related content recommendation in AnQiCMS is to take advantage of its powerfularchiveListand cooperate withtype="related"Properties. When we are on an article detail page, this tag can intelligently identify the current article and automatically grab related content associated with it.
By default,type="related"This feature recommends some nearby articles in the same category as the current article based on its category, which is a very basic and practical relevance judgment. However, if you need more accurate recommendations, AnQiCMS also provideslikeParameters can be used to refine the recommendation logic:
like="keywords":If you fill in keywords for the article when publishing it on the backend (these keywords are also often used for SEO optimization), thenarchiveListThis can be used to find other articles with similar keywords for recommendation. This makes the recommended content more closely aligned with the article's theme.like="relation":For recommendation scenarios that require manual intervention, this parameter comes into play.You can manually specify other articles related to the current article when editing articles in the AnQiCMS backend.archiveListWill only display the relevant content you explicitly specify, achieving highly customized recommendations.
It is very intuitive to call such recommended content in the template. You just need to add it at the appropriate position in the article detail page.archiveListTag, and specifytype="related"andlimit(Control the number of displays), for example:
{# related 相关文档列表展示 #}
<div>
<h3>相关推荐</h3>
<ul>
{% archiveList archives with type="related" limit="5" %}
{% for item in archives %}
<li>
<a href="{{item.Link}}">
<h5>{{item.Title}}</h5>
<p>{{item.Description}}</p>
{% if item.Thumb %}
<img alt="{{item.Title}}" src="{{item.Thumb}}">
{% endif %}
</a>
</li>
{% empty %}
<li>暂无相关推荐内容。</li>
{% endfor %}
{% endarchiveList %}
</ul>
</div>
In this code,archivesis an array that contains recommended article information. You can easily get the title of each article (item.Title), link (item.Link), thumbnails (item.Thumb) and brief descriptions (item.Description) and other information, and display them according to your page design.limit="5"It limits the maximum number of recommended items displayed to 5.
Enhance relevance: Use the strategy of tags (Tags)
ExceptarchiveListoftype="related"属性外,AnQiCMS 的标签功能也是构建相关内容列表的强大工具。标签可以将内容主题化,让同一话题下的文章彼此关联。
In AnQiCMS backend, when you publish or edit articles, you can add multiple 'tags' to the articles.These tags are somewhat similar to topics, which can link content scattered across different categories through common keywords.For example, an article about "SEO optimization techniques" can be tagged with "SEO
AlthougharchiveList type="related"Already smart, but if you want to recommend content strictly based on certain specific tags, you can adopt the following strategies:
- Show the tags of the current article:Firstly, the list of tags associated with the current article can be displayed on the article detail page. This itself can provide readers with clues for further exploration.
<div> <strong>当前文章标签:</strong> {% tagList tags with itemId=archive.Id limit="10" %} {% for item in tags %} <a href="{{item.Link}}">{{item.Title}}</a> {% endfor %} {% endtagList %} </div> - Get more articles based on tags:Next, you can combine
tagDataListTags. Although this is usually used on the tag detail page