When visitors read a document of interest or browse a product introduction on your website, if they can obtain more relevant recommendations in time, it will undoubtedly greatly enhance their visit experience, extend their stay time, and encourage them to explore more corners of the website.Auto CMS knows this point, providing flexible and diverse functions to help you cleverly display related recommendations on the document detail page, and can customize the recommendation logic according to your operational strategy.
Next, we will discuss in detail how to implement this feature in Anqi CMS.
Understand the 'Related Recommendations' in Anqi CMS
In the Aanqi CMS, the related recommendations on the document detail page mainly depend onarchiveListThis powerful tag. By reasonably configuring its parameters, you can easily implement various recommendation strategies. The most direct way is to usetype="related"Parameters allow the system to intelligently search for content that is closest to the current document.
1. Recommended basic related documents
Firstly, you need to locate the template you are currently using, usually the path of the document detail page template file is like/template/{模型table}/detail.html. For example, if it is an article model, it may be/template/article/detail.html.
In this template file, you can insert the following code snippet at the bottom or in the sidebar of the document content, etc., to display the system default recommended related documents:
<div class="related-documents">
<h3>相关推荐</h3>
<ul>
{% archiveList relatedDocs with type="related" limit="5" %}
{% for item in relatedDocs %}
<li>
<a href="{{ item.Link }}">{{ item.Title }}</a>
</li>
{% endfor %}
{% empty %}
<li>暂无相关推荐。</li>
{% endarchiveList %}
</ul>
</div>
This code will retrieve 5 documents related to the current document (the system will automatically identify the current document ID).type="related"Parameters enable the AnQi CMS backend logic to automatically determine which content is 'related', usually based on factors such as the same category, same keywords, etc. for intelligent matching.
Custom recommendation logic: Make recommendations more 'understand' your users
Anqi CMS'sarchiveListTags are not limited to default related recommendations, they also providelikeParameters and other rich filtering conditions, allowing you to finely control the recommended content.
2. Smart recommendation based on keywords
If you want to recommend content that is more focused on the keyword matching degree of the document, you can uselike="keywords"This means that the system will match the keywords of the current document with the keywords of other documents to find recommendations with more consistent content themes.
Backend settings:When editing documents in the AnQi CMS backend, be sure to fill in accurate and representative keywords in the 'Document Keywords' field, separated by English commas,The quality of keywords directly affects the accuracy of recommendations.
Template Code:
<div class="related-by-keywords">
<h3>更多您可能感兴趣的</h3>
<ul>
{% archiveList keywordsRelated with type="related" like="keywords" limit="5" %}
{% for item in keywordsRelated %}
<li>
<a href="{{ item.Link }}">{{ item.Title }}</a>
</li>
{% endfor %}
{% empty %}
<li>暂无更多相关内容。</li>
{% endarchiveList %}
</ul>
</div>
3. Precise recommendations based on manual association in the background.
Sometimes, you may want to manually specify the relevance between certain documents, such as recommendations for product series, specific thematic articles, etc. Anqi CMS provides the function to manually set "related documents" in the background, and you canlike="relation"Parameters can be used to call this manually associated content.
Backend settings:When editing documents in the AnQi CMS backend, you usually find the 'Related Documents' option in the 'Other Parameters' or similar collapsible panel.Here, you can manually search and select other documents related to the current document.This method provides the highest recommendation accuracy and is completely controlled by the operator.
Template Code:
<div class="manually-linked-recommendations">
<h3>为您精选</h3>
<ul>
{% archiveList manualRelated with type="related" like="relation" limit="5" %}
{% for item in manualRelated %}
<li>
<a href="{{ item.Link }}">{{ item.Title }}</a>
</li>
{% endfor %}
{% empty %}
<li>运营者暂未手动配置相关推荐。</li>
{% endarchiveList %}
</ul>
</div>
4. Flexible recommendations based on categories, recommendation attributes, or other conditions
Excepttype="related"The intelligent or manual association brought, you can also usetype="list"Create a recommendation list based on various parameters, including categories, recommendation attributes (such as "Top StoriesThis is a more general way of calling a list, but it can also be used as a supplement to related recommendations.
Backend settings:
- Document Category:When publishing or editing documents, ensure that the category to which the document belongs is accurate.
- Recommended properties:In the document editing page, you can select 'Recommended Attributes' for documents, such as 'Recommended[c]' and 'Slide[f]'.
- Number of views:This is an automatically generated indicator, no additional settings are required.
Template code example (recommended to browse the top 5 articles in the current category, but excluding the current document):
Firstly, we need to obtain the classification ID and document ID of the current document to filter and exclude.
English