The `prevArchive` tag can retrieve which basic information of the previous document?

Calendar 👁️ 71

As an experienced website operation expert, I often deal with AnQiCMS (AnQiCMS) in my daily work, and I am well aware of its powerful and flexible template tags. Today, let's delve into a crucial tag in content navigation -prevArchiveIt can help us easily implement a seamless jump to the "previous document" and it can provide some basic information about the previous document, making our website content operation more skillful.

Unlock the previous exciting article: In-depth analysis of AnQi CMSprevArchiveWhat kind of document information can tags obtain

In AnQi CMS,prevArchiveTags are a good helper for content detail pages, their core function is to help users smoothly jump to earlier documents in terms of time or sorting after reading the current document, thereby providing a coherent reading experience.This not only optimizes the user's stay time on the website, but also indirectly enhances the internal link structure of the website, which has a positive effect on SEO.

UseprevArchiveTags are very intuitive, and their basic form is{% prevArchive prev %}...{% endprevArchive %}. Here, we usually define a variable (such as the example in theprev), to carry all the available information automatically recognized by the system for the previous document. It is worth noting that,prevArchiveWhen calling the tagNo additional parameters are requiredTo specify which document is the previous one, the system will automatically locate it intelligently based on the context of the current page.

Then, when we go throughprevArchiveHow can you get practical basic information from the previous document after successfully obtaining theprevvariable? Next, I will reveal it to you one by one.

1. Basic Identity and Navigation Information: The 'business card' of the document

When we talk about a document, the first thing that comes to mind is its identity and how to access it.prevArchiveThis label provides comprehensive basic information:

  • Document ID (Id)This is the unique identifier for each document in the AnQi CMS system, although it is usually not displayed directly on the front end, but it is the basis for internal logic and data association.
  • Document title (Title)This is the most direct and important information, usually used to display in navigation links, allowing users to understand the theme of the previous document at a glance, for example, 'Previous: Use of AnQi CMS template tags.'
  • Document link (Link):There is no doubt that this is the 'life line' for achieving the jump. Obtaining toLinkAfter the field, we can build a clickable hyperlink to guide the user to the previous document.
  • Document keywords (Keywords) and document description (Description): Although this metadata is not often displayed directly in navigation, it can be used astitleproperty oraltThe supplement of properties provides richer context information for links, which is very helpful for improving SEO friendliness and providing more hints when hovering over with the mouse.

A typical text link navigation example is like this:

{% prevArchive prev %}
  {% if prev %}
    <a href="{{ prev.Link }}" title="{{ prev.Description }}">{{ prev.Title }}</a>
  {% else %}
    <span>没有更早的文档了</span>
  {% endif %}
{% endprevArchive %}

2. Content attributes and interaction metrics: Understand the 'popularity' of the document

In addition to the basic identity,prevArchiveCan provide insights into the properties of the document content and user interaction:

  • Document classification ID (CategoryId)This ID points to the category of the previous document. Through it, we can further utilizecategoryDetailTags, obtain the name, link, and other detailed information of the category, so as to achieve more accurate "previous article in the same category" navigation, and enhance the logic of content organization.
  • Document view count (Views)The number of times the previous document was accessed is displayed, which can directly reflect the popularity of the document.In some designs, operators may choose to attach the number of views next to the 'Previous Article' navigation to attract user clicks.
  • Number of document comments (CommentCount)This field shows the total number of comments under the previous document. It is also an indicator of the interaction heat of the document. If the comments are active, it can encourage users to participate in community discussions.

3. Visual Elements: Bring Navigation to Life

Navigation that is purely textual can sometimes seem monotonous, but visual elements can greatly enhance click-through rates and user experience:

  • Document cover first image (Logo) and document cover thumbnail (Thumb):LogoIt usually refers to the original large image or main image of the article, andThumbIt is a thumbnail automatically generated and optimized by the system. We strongly recommend using it when building the navigation of the previous document.ThumbA field that can provide a lightweight visual preview, without affecting page loading speed, and make navigation more vivid and interesting.

A navigation example with thumbnails is like this:

{% prevArchive prev %}
  {% if prev %}
    <a href="{{ prev.Link }}" class="prev-article-link">
      {% if prev.Thumb %}
        <img src="{{ prev.Thumb }}" alt="{{ prev.Title }}" class="prev-thumb">
      {% endif %}
      <span class="prev-title">{{ prev.Title }}</span>
    </a>
  {% else %}
    <span class="no-prev-article">没有更早的文档了</span>
  {% endif %}
{% endprevArchive %}

4. Time information: Master the 'age' of the document

The time of document publication and update, which is an important basis for evaluating the timeliness of certain types of content (such as news, technical articles):

  • Document added time (CreatedTimeAnd document update time (UpdatedTime)These two fields are provided in the form of timestamps. In order to display them friendlier on the front-end page, we need to use the provided by AnQi CMSstampToDateThe filter performs formatting. For example,{{ stampToDate(prev.CreatedTime, "2006-01-02") }}The timestamp can be converted to the format “year-month-date”, which is convenient for users to understand the publication or latest update date of the content.

Integrate the above informationprevArchiveTags can give you great flexibility and expressiveness when building website navigation.It is not just a simple link, but also an effective bridge connecting users with content and enhancing the overall website experience.


Frequently Asked Questions (FAQ)

Q1: If the current document is the first one in this category,prevArchivewhat will the tag display?

A1:If the current document is already the oldest one in its category or within the global range, meaning there is no previous document to retrieve, then{% prevArchive prev %}in the labelprevthe variable will be null (ornil)。Therefore, always use it in the template{% if prev %}Such conditional judgment to check if a variable exists is a very robust and recommended practice to avoid blank or error messages when there is no previous document.

Q2:prevArchiveandnextArchiveHow are the ways of using tags different? Do they provide the same information?

A2: prevArchiveUsed to get the 'previous' document, andnextArchiveIt is used to get the 'next document'. They are functionally complementary and usually appear in pairs at the bottom of the document details page, providing the full article

Related articles

What is the correct syntax and example of using the `prevArchive` tag?

## Smart Content Link Flow: Deep Analysis of the Correct Usage and Practice of AnQiCMS `prevArchive` Tag In the daily operation of AnQiCMS, we fully understand that providing users with a smooth reading experience is crucial for retaining visitors and enhancing the value of the website.A great website is not only rich in content, but also seamless in the connection between content, guiding users to naturally explore more information.Today, as an experienced website operations expert, I will take everyone to deeply understand AnQiCMS

2025-11-07

What is the function and advantage of the `prevArchive` tag in Anqi CMS?

In the world of content operation, user experience and search engine optimization (SEO) are always the two fundamental cornerstones of website success.AnQi CMS, as an enterprise-level content management system built with Go language, deeply understands this, and helps operators easily achieve their goals through a series of simple and powerful features.Today, we will focus on a seemingly minor, but actually profound member of its template tag system - the `prevArchive` tag, discussing how it silently enhances the value of the website and provides readers with a more seamless browsing experience.

2025-11-07

How can you display the link to the previous document on the article detail page?

As an experienced website operations expert, I am well aware of the importance of navigation design on article detail pages for user experience and search engine optimization (SEO).A well-designed and functional detail page that not only guides users to explore more content, effectively reducing the bounce rate, but also helps to build a good site structure through internal links, aiding search engine crawling and ranking.AnQiCMS (AnQiCMS) with its high-performance architecture based on the Go language and flexible template mechanism, provides us with powerful and convenient tools to achieve these refined operational goals. Today

2025-11-07

How to get the title of the previous article in the AnQiCMS template?

In website content operation, providing a smooth reading experience is the key to improving user stickiness.When the reader is immersed in an excellent article, it is natural to want to easily jump to related content, especially the previous or next one.This is not a difficult thing to achieve in AnQiCMS (AnQiCMS), such an efficient and customizable content management system.Today, let's delve into how to cleverly retrieve and display the title of the previous article in the AnQiCMS template.## AnQiCMS template

2025-11-07

How to determine if the previous document exists and perform conditional rendering in the AnQiCMS template?

## AnQiCMS template development: The exquisite implementation of conditional rendering for previous/next document In content-based websites, guiding users to browse related content is one of the key strategies to enhance user experience and deepen the value of the website.Whether it is a blog post, product detail page, or news information, reasonable 'Previous' and 'Next' navigation can effectively extend the user's stay on the site and encourage them to discover more interesting content.AnQiCMS as an efficient and customizable enterprise-level content management system provides powerful and intuitive template tag support. Today

2025-11-07

How to elegantly display a 'none' prompt when there is no previous document for the `prevArchive` tag?

In the daily operation of AnQiCMS, the content detail page usually contains 'Previous' and 'Next' navigation for the convenience of users browsing.This is not only the key to improving user experience, but also an important link in optimizing the association between pages and helping SEO.However, when a user visits the first piece of content on a website, or the latest content in a category, the 'previous' document naturally does not exist.At this time, if the template is not handled properly, it may cause blank areas on the page, style disorders, and even leave a bad user experience

2025-11-07

The `prevArchive` tag supports which parameters to filter or specify the previous document (the document mentions that no parameters are supported, but users may still ask)?

In AnQiCMS template development, the `prevArchive` tag is a very practical tool that can easily help us implement the navigation function of the "previous article" document on the article detail page, thereby optimizing the user's browsing experience.As a website operations expert, I fully understand the importance of smooth page transitions and convenient content discovery for user retention and SEO.However, whether the `prevArchive` tag supports parameters to filter or specify the previous document is often a question many users have when exploring the features of AnQiCMS

2025-11-07

How to use the `prevArchive` tag to display the thumbnail or cover image of the previous document?

## Enhance Content Relevance: Use the `prevArchive` tag in AnQiCMS to display the thumbnail or cover image of the previous document In today's increasingly fragmented content consumption, how to effectively guide users to browse more content, improve the stay time on the website, and enhance the user experience is a problem that every website operator needs to think deeply about.AnQiCMS as a highly efficient and customizable enterprise-level content management system provides many powerful template tags, making content operation and display extremely flexible. Today

2025-11-07