How to retrieve related content of the current document using the `archiveList` tag's `type="related"` mode?

Calendar 👁️ 57

As an experienced website operation expert, I am more than willing to deeply analyze AnQiCMS in detailarchiveListlabel'stype="related"Pattern, it plays a crucial role in content operation, effectively enhancing user experience and the website's SEO performance.


In-depth analysis of AnQiCMS'sarchiveListLabel: How to intelligently obtain relevant content and enhance user experience

In AnQiCMS such an efficient and customizable content management system, the effective organization and recommendation of content are the key to the success of website operation.We not only need to publish high-quality content, but also understand how to intelligently link these contents together to guide users to in-depth reading.archiveListLabel, as a core component of the AnQiCMS template system, is one of the powerful tools to achieve this goal, and itstype="related"The pattern is specifically designed for the "related content recommendation" scenario.

When a user is immersed in an article or a product detail page, they often expect to find more information related to their current interest point.At this point, precise content recommendation becomes particularly important.It can not only extend the user's stay time on the website, reduce the bounce rate, but also optimize the website's search engine ranking through the construction of internal links.AnQiCMS'archiveListTags, intype="related"In this mode, it can intelligently pick out highly relevant content from a massive amount of content, without complex logical judgments, greatly simplifying the difficulty of template development and content operation.

Core Mechanism: How is relevant content defined?

archiveListThe tag is intype="related"Under 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 characteristics 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 detail page, AnQiCMS will intelligently find and recommend 'documents nearby' in the same category as the current document.Here, 'proximity' usually refers to the closeness in terms of publishing time, ID, and the like, aiming to present articles that are thematically similar and have a relatively close publishing time.Operational Value:This method does not require additional configuration and allows users to smoothly browse similar topics.For example, an article about the "AnQiCMS deployment tutorial" may automatically appear with 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 and other content operation scenarios.

  2. Keyword-driven: Precise association based on the first keywordIf you want the content recommendations to be more strategic, you can use the keywords of the document. By addinglike="keywords"the parameters to the tags, AnQiCMS will base its recommendations on the current document'sfirst keywordgo to match other documents that also contain this 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 also be associated with the "Marketing" category under which there are documents containing the same keyword "SEO optimization".This helps to break down the barriers of classification, achieve cross-classification content interconnection, especially suitable for websites with clear keyword strategies.

  3. Manually precise association: exclusive recommendation designated by the operatorFor those who need highly accurate or edited recommendations,like="relation"The parameter is your ideal choice. In this mode, AnQiCMS will only display in the background document editing interface, by the operatormanually set and associatedrelevant documents.Operational Value:This approach provides ultimate precision. You can manually select the most relevant content for users based on content quality, promotion needs, or special events.This is an indispensable tool for special topic planning, hot recommendations, or content marketing activities that require strong guidance.

How to use in practice?

Used in AnQiCMS template filesarchiveListlabel'stype="related"The pattern is very intuitive. You just need to place it in the corresponding position on the document detail page, and combineforwith loops to iterate and display the relevant content.

An example of a typical related content call is as follows:

{# 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 to get the related documents and store the results inarchivesthe variable, while limiting the display quantity to 5 items.
  • By{% for item in archives %}Loop through each related document.
  • item.LinkGet the document link,item.TitleGet the document title,item.ThumbRetrieve thumbnails,item.DescriptionGet the document description (and through)truncatechars:80Truncate to display the first 80 characters),item.CreatedTimeGet the publish time (through)stampToDateFormatted),item.ViewsView the number of page views.
  • {% empty %}The clause elegantly handles the scenario where there is no relevant content, displaying a friendly prompt to the user, thus improving 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

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


Frequently Asked Questions (FAQ)

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

  1. Label position:Ensuretype="related"The label is placed inDocument detail 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 (for example, with similar publication times).
    • Keyword pattern (like="keywords"):Confirm that the current document and the target related documents are set to the same.first keyword.
    • Manual association mode (like="relation"):Check if the current document has manually associated other documents during background editing.
  3. **Number of contents

Related articles

How to use the `archiveList` tag to perform keyword search (using `q` parameter) to filter documents on the frontend page?

## Unlock AnQiCMS: Use the `archiveList` tag to implement keyword search and content filtering on the front-end page As an experienced website operations expert, I am well aware of the importance of an efficient and flexible content management system for enterprises.AnQiCMS, this system developed based on the Go language, with its excellent performance and rich features, is becoming the preferred choice for an increasing number of small and medium-sized enterprises and content operation teams.In today's era of information explosion, whether users can quickly find the content they need is directly related to the user experience and conversion rate of the website.

2025-11-06

How to set the display quantity and offset for the `archiveList` tag in AnQiCMS to achieve pagination?

As an experienced website operations expert, I know that an efficient and flexible list display method is crucial for user experience and website performance.AnQiCMS (AnQiCMS) provides us with great convenience with its powerful template tag system.Today, let's delve into how to cleverly set the display quantity and offset using the AnQiCMS `archiveList` tag to achieve a smooth pagination effect.

2025-11-06

How to implement sorting of the document list by views or publication time using the `archiveList` tag?

As an experienced website operations expert, I know that the core value of a content management system (CMS) lies in its flexibility and the efficiency of content presentation.AnQiCMS (AnQiCMS) excels in this aspect with its efficient architecture in the Go language and a rich set of features.Today, let's delve deeply into a function that is extremely commonly used in content operation: how to use the `archiveList` tag to sort the document list by views or publication time.Content sorting seems simple, but it actually contains profound operational strategies.

2025-11-06

How to use the `archiveList` tag to get documents with specific recommended attributes (such as "Top Stories" or "Slideshow")?

As an experienced website operations expert, I am well aware of the core value of a content management system (CMS) in terms of its flexibility and content scheduling capabilities.AnQiCMS (AnQiCMS) boasts its efficient architecture based on the Go language and rich features, providing strong support for content operations.Today, let's delve into a very practical scenario in content operation: how to accurately obtain and display documents with specific recommendation attributes using the `archiveList` tag, such as the website's 'headlines' news or important content for the 'slideshow' carousel.

2025-11-06

How to call the document data of different sites (`siteId`) through the `archiveList` tag?

As an experienced website operations expert, I fully understand the challenges you may encounter when managing multi-site content.AnQiCMS (AnQiCMS) provides us with great convenience with its powerful multi-site management capabilities.Today, let's delve into how to use the `archiveList` tag and its core parameter `siteId` to easily implement cross-site document data calls.

2025-11-06

How to get the thumbnail, description, and publish time of the document in the `archiveList` loop?

As an experienced website operations expert, I know that how to efficiently and flexibly display content in a content management system is one of the key factors for the success of a website.AnQiCMS (AnQi CMS) relies on its powerful template engine and simple tag design, making content display extremely convenient.Today, let's delve into a very practical scenario: how to elegantly obtain and display the thumbnail, description, and publication time of documents in the `archiveList` loop.

2025-11-06

How to display the Flag attribute of the document in the `archiveList` loop, for example, 'Recommended' or 'Bold'?

As an experienced website operations expert, I am happy to deeply analyze how to flexibly use the `archiveList` loop in AnQiCMS to display the Flag attribute of documents, such as "recommended" or "bold".The core of content operation lies in how to effectively distinguish and highlight key content, and the Flag attribute is a powerful and easy-to-use feature provided by AnQiCMS for this purpose.--- ### Light up your content

2025-11-06

How to combine `archiveList` with `pagination` tag to implement pagination navigation for document list?

As an experienced website operation expert, I am well aware of the importance of an efficient content management system (CMS) for website operation. AnQiCMS, with its high concurrency features in Go language and flexible template mechanism, has provided us with great convenience.Among many features, how to effectively display a large number of documents and provide friendly pagination navigation is crucial for improving user experience and content accessibility.Today, let's delve into how the `archiveList` tag cleverly combines with the `pagination` tag

2025-11-06