Can the `prevArchive` tag also be used to get the previous product on non-article (such as product) detail pages?

Calendar 👁️ 79

AnQi CMS, as an enterprise-level content management system developed based on the Go language, has won the favor of many small and medium-sized enterprises and content operation teams with its high efficiency, flexibility, and easy expandability.In the daily content operation, we often encounter the need to provide 'Previous' and 'Next' navigation on the content detail page, which not only optimizes user experience and extends user time on the site, but also helps search engines better capture the internal links of the website.

Many AnQiCMS users may have a question: for the article detail page'sprevArchiveTags, can it also be flexibly applied to non-article content, such as product detail pages, to get the previous or next product?Today, let's delve deeply into this issue.

The unity of AnQiCMS content model:archivePhilosophy

To answer this question, we need to first understand the core design concept of AnQiCMS in content management.AnQiCMS is a major highlight with its flexible content model.This means that the system is not limited to the traditional 'article' concept, but allows users to customize various content types according to their business needs, such as products, news, cases, events, and so on.This highly customized capability greatly enhances the adaptability of the system, allowing AnQiCMS to meet various content publishing scenarios.

In the evolution process of AnQiCMS, it is particularly noteworthy that a significant update was made to version 2.1.1:“Redo the template tag, remove the original article/product tag, and add the new archive tag”This change is not a simple name replacement, it marks the realization of the content model unification at the template tag level of AnQiCMS.

After that, whether it is an 'article' or a 'product', it is generalized as the common concept 'archive' in the template.This means that when you create a "product modelThis uniformity lays the foundation for the generalized use of template tags, greatly simplifying the work of template developers.

prevArchiveTag: The realization of general content navigation.

Based on the consistency of "archive", we can now clearly answer this question:Yes,prevArchiveThe tag can be used for non-article content (such as products) detail pages to get the previous product.

prevArchiveandnextArchiveThese tags are designed by AnQiCMS specifically for content detail pages, their core function is to intelligently recognize and provide links and information for the previous or next 'archive' content within the current 'archive' context. Since AnQiCMS unifies all model content into 'archive', whether you are browsing the details of an 'article' or a 'product' detail page,...prevArchiveandnextArchiveTags can accurately retrieve the previous or next record under the corresponding content model based on the "archive" context of the current page.

These tags are very concise in use, no additional parameters are needed to specify the content model ID or category ID, they willautomatically identify the content model and context of the current page.For example, when you are browsing a product details page, the system knows that the current page is an 'archive' entry under a certain product model, and automatically looks for the previous or next product in all products included in the product model.

Let's take a lookprevArchiveandnextArchiveThe basic usage of tags and the fields they support:

{# 假设这是产品详情页的一个片段 #}

<div class="product-navigation">
  {% prevArchive prev %}
    {% if prev %}
      <a href="{{ prev.Link }}" class="prev-product">
        <img src="{{ prev.Thumb }}" alt="{{ prev.Title }}">
        <span>上一篇:{{ prev.Title }}</span>
      </a>
    {% else %}
      <span class="no-prev">没有上一篇产品了</span>
    {% endif %}
  {% endprevArchive %}

  {% nextArchive next %}
    {% if next %}
      <a href="{{ next.Link }}" class="next-product">
        <img src="{{ next.Thumb }}" alt="{{ next.Title }}">
        <span>下一篇:{{ next.Title }}</span>
      </a>
    {% else %}
      <span class="no-next">没有下一篇产品了</span>
    {% endif %}
  {% endnextArchive %}
</div>

In this example,prevandnextThe variables will include the following available fields, which are general and applicable to any "archive" type of content:

  • Id(Content ID)
  • Title(Title, i.e., product name)
  • Link(Detail Page Link)
  • Keywords(Keywords)
  • Description(Introduction)
  • CategoryId(Category ID)
  • Views(Views)
  • Thumb(Thumbnail, Product Image)
  • CreatedTime(Creation Time)
  • UpdatedTime(Update Time)
  • ...and other custom fields

Whether it is the title, abstract, or name, thumbnail of an article, or product, these common fields can be used to obtain and display.This greatly simplifies the reusability of templates, no need to write different previous/next logic for different content types.

Summary

AnQiCMS through its highly flexible content model and unifiedarchivelabel system, brings great convenience to content operation.prevArchiveandnextArchiveThe tag is the embodiment of this design concept, no longer confined to traditional article content, but can intelligently apply to any custom content model (including product models) detail page, providing a smooth previous/next navigation experience.This not only improved the website's user experience and internal link structure, but also made template development and content management more efficient and intuitive.


Frequently Asked Questions (FAQ)

  1. prevArchiveandnextArchiveWill it consider the classification of content? For example, on the mobile details page, it will only show the previous/next mobile phone, but not the notebook?Generally speaking,prevArchiveandnextArchiveThe tags will be based on the current page locationContent Model (Module)Find the previous or next content.This means that if you use these tags on a "mobile productprevArchiveandnextArchiveSupportcategoryIdParameters, which means they are mainly based onthe order under the global or current content modelto judge. If strict classification navigation within is needed, it may be necessary to combinearchiveListtags to perform

Related articles

How to flexibly call the `prevArchive` tag in the sidebar or footer area of the article page?

## Enhance User Experience: Flexibly use the `prevArchive` tag on the Anqi CMS article page to create a smooth navigation As an experienced website operations expert, I know how important it is for users to have a smooth browsing experience. In the era of information explosion, guiding users to naturally move to the next related content after the end of a page can not only effectively increase the time users spend on the website and reduce the bounce rate, but also optimize the internal link structure of the website and help improve SEO performance.

2025-11-07

Can the `prevArchive` tag retrieve documents across sites in the AnQiCMS multi-site management environment?

Hello, all website operation colleagues, How to efficiently and accurately call content in the AnQiCMS multi-site management environment has always been a focus of everyone.Today, let's delve into a common problem in template creation: Can the `prevArchive` tag retrieve documents across sites?The essence of the AnQiCMS multi-site architecture First, let's review the multi-site management function of AnQiCMS.AnQiCMS is known for its powerful multi-site support

2025-11-07

If the previous document has not set a thumbnail or Logo, what placeholder will the `prevArchive` tag display?

As an experienced website operations expert, I know that every detail can affect user experience and the professionalism of content presentation.In a powerful content management system like AnQiCMS, how to elegantly handle content display, especially visual elements like images, is something operators need to pay special attention to.Today"---## Reveal"

2025-11-07

Does the `prevArchive` tag get the comment count (`CommentCount`) of the previous document data?

As an experienced website operations expert, I know that how to efficiently call and display data in a content management system is the key to improving user experience and operational efficiency.When using AnQiCMS for content creation and site maintenance, friends often ask such detailed questions: Does the `prevArchive` tag include the number of comments (`CommentCount`) in the data of the previous document obtained?### AanQi CMS `prevArchive` tag and comment count

2025-11-07

The `prevArchive` tag gets the previous document. Is the `Link` field an absolute URL or a relative URL?

As an experienced website operation expert, I know that every CMS detail may affect the performance, user experience, and even SEO effects of the website.When using an efficient and powerful system like AnQiCMS, some seemingly minor label behaviors are all imbued with the careful consideration of system designers.Today, let's delve deeply into a question that many developers and operators have been curious about: 'Is the `prevArchive` tag getting the link field of the previous document, an absolute URL or a relative URL?' ###

2025-11-07

How to configure to hide the `prevArchive` tag under certain article types?

As an experienced website operations expert, I am more than willing to discuss with you the subtle aspects of AnQiCMS (AnQiCMS) in content operations, especially how to achieve fine-grained control of content through its flexible template configuration, such as hiding the "Previous Article" navigation under specific article types.The Anqi CMS, with its efficient architecture based on the Go language and excellent customizability, provides us with great freedom.In daily content operations, we often hope that the website can intelligently display content, both convenient for users to browse and in line with the business logic of different content types

2025-11-07

How is the compatibility and display effect of the `prevArchive` tag in responsive design or mobile template?

As an experienced website operations expert, I am well aware that in today's mobile-first era, responsive web design and mobile experience are crucial.AnQiCMS provides an efficient and flexible content management solution while fully considering this point.Today, let's delve into a seemingly simple but profoundly influential tag in Anqi CMS——`prevArchive`, its compatibility and actual display effect in responsive design and mobile template.

2025-11-07

The link to the previous document generated by the `prevArchive` tag, can its HTML structure be fully customized?

As an expert in the operation of AnQiCMS, I know how important template flexibility is for content display and SEO optimization.Today, let's delve into the discussion of the 'previous document' link generated by the `prevArchive` tag in AnQiCMS, whether its HTML structure can be fully customized to meet our needs.### Core Functionality and Flexibility: The Essence of `prevArchive` Tag AnQiCMS Template System

2025-11-07