`archiveList` label's `type=`

As an experienced website operations expert, I am happy to delve into AnQiCMS for youarchiveListTagstype="related"Pattern, it plays a crucial role in content operation, and can effectively enhance user experience and the SEO performance of the website.


In-depth analysis of AnQiCMSarchiveListTag: How to intelligently fetch relevant content and improve user experience

In an efficient and customizable content management system like AnQiCMS, effective content organization and recommendation are the key to the success of website operation.We must not only publish high-quality content, but also understand how to intelligently link these contents together, guiding users to engage in in-depth reading.archiveListTag, as one of the core components of AnQiCMS template system, is one of the magical tools to achieve this goal, and itstype="related"Pattern, which is specifically designed for the "Content Recommendation" scenario.

When users immerse themselves in an article or a product detail page, they often expect to find more information related to their current points of interest.This is when precise content recommendation becomes particularly important.It not only extends the user's stay on the website and reduces the bounce rate, but also optimizes the website's search engine ranking through the construction of internal links.archiveListTags, intype="related"In mode, it can intelligently select content highly relevant to the current document from a massive amount of content, without complex logical judgment, greatly simplifying the difficulty of template development and content operation.

Core Mechanism: How is relevant content defined?

archiveListTags intype="related"In the mode, the definition of 'relevance' is not a single dimension, but provides three flexible and powerful matching logic to meet the needs of different content strategies.This means you can choose the most suitable association method based on content features and operational objectives.

  1. Automatic Smart Matching: Documents close to the same categoryThis istype="related"The default behavior of the pattern, which is also the most convenient and efficient way.When you call this tag on the document details page, AnQiCMS will intelligently find and recommend 'similar documents' under the same category as the current document.The term 'close proximity' usually refers to the similarity in aspects such as publishing time, ID, etc., aiming to present articles that are thematically close and have a similar publishing time.Operational Value:This method requires no additional configuration and allows users to browse smoothly within similar topics.For example, an article about the 'AnQiCMS Deployment Tutorial' may automatically display related content such as 'AnQiCMS Template Creation Guide' or 'AnQiCMS Latest Version Update', forming a natural reading flow, which is very suitable for knowledge sharing, blog content operation scenarios.

  2. Keyword-driven: Precise correlation based on the first keywordIf you want to make the content recommendations more strategic, you can use the keywords in the document. By adding the parameters to the tags,like="keywords"AnQiCMS will base the recommendations on the current document'sThe first keywordto match other documents that contain the same keyword.Operational Value:This pattern gives content operators greater control.For example, if the first keyword of a document is 'SEO optimization', then even if it belongs to the 'Technical Sharing' category, it can be associated with documents under the 'Marketing' category that also contain the keyword 'SEO optimization'.This helps break down the barriers of classification and achieve interconnection of content across categories, especially suitable for websites with clear keyword strategies.

  3. Manual precise association: operator's exclusive recommendationFor content that requires high precision or editing recommendations,like="relation"Parameters are your ideal choice. In this mode, AnQiCMS will only display in the background document editing interface, by the operatormanually set and associateddocuments.Operational Value:This method provides ultimate precision.You can manually select the most attractive content to users based on content quality, promotion needs, or special events.This is an indispensable tool for thematic planning, hot recommendations, or content marketing activities that require strong guidance.

How to use in the template?

Use in AnQiCMS template filesarchiveListTagstype="related"The pattern is very intuitive. You just need to place it in the corresponding position on the document detail page, and combine withforLoop to traverse and display relevant content.

The following is a typical example of a relevant content call:

{# related 相关文档列表展示 #}
<div class="related-articles-section">
    <h3>猜你喜欢</h3>
    <ul class="related-articles-list">
    {% archiveList archives with type="related" limit="5" %}
        {% for item in archives %}
        <li class="related-article-item">
            <a href="{{item.Link}}" title="{{item.Title}}">
                {% if item.Thumb %}
                <img src="{{item.Thumb}}" alt="{{item.Title}}" class="related-article-thumb">
                {% endif %}
                <h5 class="related-article-title">{{item.Title}}</h5>
            </a>
            <p class="related-article-desc">{{item.Description|truncatechars:80}}</p>
            <div class="related-article-meta">
                <span>{{stampToDate(item.CreatedTime, "2006-01-02")}}</span>
                <span>阅读量:{{item.Views}}</span>
            </div>
        </li>
        {% empty %}
        <li class="no-related-content">
            目前暂无相关内容推荐,敬请期待!
        </li>
        {% endfor %}
    {% endarchiveList %}
    </ul>
</div>

In this example, we:

  • usedarchiveList archives with type="related" limit="5"to declare the relevant documents to be retrieved and store the results inarchivesIn variables, limit the display quantity to 5 items.
  • Pass{% for item in archives %}Loop through each related document.
  • item.LinkGet the document link,item.TitleGet the document title,item.ThumbGet the thumbnail,item.DescriptionGet document description (and)truncatechars:80truncated to display the first 80 characters),item.CreatedTimeGet publish time (through)stampToDateformatted),item.ViewsGet the number of views.
  • {% empty %}The clause elegantly handles the scenario of displaying a friendly prompt to the user when there is no relevant content, enhancing the user experience.

You can add as needed,like="keywords"orlike="relation"Parameters to switch the matching logic of related content. For example, to recommend based on keywords: {% archiveList archives with type="related" like="keywords" limit="5" %}

To recommend based on manually set associations in the background: {% archiveList archives with type="related" like="relation" limit="5" %}

Summary

AnQiCMSarchiveListlabel combined withtype="related"Pattern provides great flexibility and convenience for website operators, making content recommendations simple and efficient.Whether it's relying on the system to automatically discover, intelligent matching based on keywords, or manual precise association by the operator, it can help you build a website with interconnected content and a smooth user experience.By reasonably utilizing this feature, you can effectively guide users to conduct in-depth browsing, enhance the value of the content, and lay a solid foundation for the SEO optimization of the website.


Common Questions (FAQ)

Q1: Why is my document detail page not displaying any related content, even though I have addedtype="related"tags for the mode?A1: If the related content is not displayed, please check the following points:

  1. Label Position:Ensuretype="related"The label is placed inDocument details pagethe template because its matching logic depends on the context of the current document.
  2. Content Matching Conditions:
    • Default Mode:Check if there are other documents under the current document's category, and whether these documents are 'close' to the current document (e.g., with similar publication time).
    • Keyword pattern (like="keywords"):Confirm that the current document and the target related documents are both set to the sameThe first keyword.
    • Manual association mode (like="relation"):Check if the current document has manually associated other documents during background editing
  3. **Number of contents