What are the commonly used fields that can be called with the `archiveDetail` tag on the article detail page?

Calendar 👁️ 75

AnQiCMS (AnQiCMS) provides great convenience to website operators with its flexibility and powerful content management capabilities. When we carefully create an article or product page and hope to accurately display its colorful content to visitors, archiveDetailTags are an indispensable tool in our hands. They are like a treasure trove of information, allowing us to easily call up all related data of the current content on the article detail page.

In the article detail page template, it is often possible to directly{{archive.字段名}}in the form to call various properties of the current document. Of course, you can also use more explicit{% archiveDetail with name='字段名' %}To retrieve tags, especially when you need to obtain information about a specific document ID. Below, we will delve deeper.archiveDetailThe tag is a commonly used call field on the article detail page, which helps you better understand and apply it.

Content core and SEO optimization

Firstly, let's take a look at the key information that constitutes the basic framework of the content.IdRepresents the unique identifier ID of the document,TitleThe core title of the article or product, these are the most intuitive and most important elements on the page. What is closely related to the title isSeoTitle/KeywordsandDescriptionThey are used to optimize the page title, keywords, and description displayed by search engines, which is crucial for improving the search visibility of the website.

Furthermore,LinkThe field provides a complete access link to the current document andCanonicalUrlIt plays an important role in SEO, indicating to search engines which is the standard version of the content, avoiding duplicate content issues. If you want to point the document to an external resource,OriginUrlCan be used to store the original link.

Main content and visual presentation

ContentThe field is undoubtedly the most important part of the article detail page, carrying all the main content of the article. Anqi CMS provides additional conveniences here, such as supporting image lazy loading, just add it when calling it.lazy="data-src"The properties can be adapted to mainstream lazy loading plugins. What is more impressive is that when you enable the Markdown editor in the background,ContentContent is automatically rendered as HTML, greatly facilitating content creation. If finer control is needed, it can be achieved byrender=true|falsemanually deciding whether to render Markdown through parameters.

For long articles,ContentTitlesThe field is very useful, it can return an array containing the titles of all levels in the article.Developers can easily use this feature to generate the table of contents (TOC) of an article, enhancing the reading experience.

in terms of visual content,Logousually refers to the first image or main image of the document,Thumbwhich is a thumbnail processed by the system. When the document contains multiple illustrations,ImagesThe field will return an array of image URLs, convenient for you to display a beautiful album or gallery through looping.

Content ownership and interactive data

The ownership and associated information of the content is also complete.CategoryIdDisplay the ID of the document category, andCategoryThe field is more powerful, it is a complete category object, from which you can obtain the title, link, description and more detailed information of the category, even including the Logo or thumbnail of the category, helping to build a clear navigation structure.

ModuleIdIt indicates the content model of the document (such as the article model, product model), which is very useful when dealing with different types of content.ParentIdUsed to handle the parent-child relationship of documents, such as the hierarchy of serial articles.

Data related to user interaction is also very important.ViewsDocument views were recorded, which is an important indicator of the popularity of the content.CommentCountIt can display the number of comments the article has received, making it easy for users to understand the interaction热度.FlagThe field is used to identify the recommended attributes of the document, such as "Top Story", "Recommended", etc., for special display in templates.UserIdIt shows the document's publisher ID.

Timestamp and custom extension

CreatedTimeandUpdatedTimeRecorded the creation and update time of the document. These fields return timestamps and need to be配合 in the template.stampToDateLabels need to be formatted in order to be presented in a human-readable date format, for example{{stampToDate(archive.CreatedTime, "2006-01-02 15:04")}}.

For product content,PriceandStockfields are used to display price and stock information.ReadLevelIt can be used to set the document reading permission level.

In addition to these built-in fields, the Anqi CMS content model supports custom fields. This means that if you add additional fields such as "author", "source", etc. in the background for a specific model, these fields can also be accessed througharchive.自定义字段名or{% archiveDetail with name="自定义字段名" %}The way to call it easily, greatly expands the flexibility of content display. When you need to get multiple custom fields, you can use{% archiveParams params %}tags to loop through and display.

In short,archiveDetailThe tag and its rich field list provides highly customized and refined content display capabilities for Anqi CMS users.Whether it is basic text information, complex text and image layouts, or product parameters and user interaction data, they can all be perfectly presented on your website details page through simple tag calls.

Frequently Asked Questions (FAQ)

  1. Why do I use it directly{{archive.Content}}This displays code with HTML tags, not formatted content?This is because the Anqi CMS template engine, for security reasons, defaults to escaping the output HTML content to prevent XSS attacks. If you are sureContentThe HTML code in the field is safe, the browser should be able to parse and display its effect normally, you need to add it when calling|safeFilter, for example{{archive.Content|safe}}.

  2. I am calling in the detail pageCreatedTimeorUpdatedTimeWhy is it showing a string of numbers instead of a date format? CreatedTimeandUpdatedTimeReturns a UNIX timestamp (a string of numbers) and not a direct date and time string. You need to use the built-instampToDatetag to convert it

Related articles

How to retrieve the list of articles under a specified category and implement pagination in AnQiCMS?

In website content operation, we often need to display articles under specific categories and provide pagination for these lists to enhance user experience and website loading efficiency.AnQiCMS (AnQiCMS) with its flexible template engine and powerful tag system can easily meet this requirement. AnQiCMS template system adopts syntax similar to Django template engine, using double curly braces `{{variable}}` to reference variables, as well as single curly braces with a percent sign `{% tag %}` to call tags.This makes the customization of content display very intuitive

2025-11-07

How to use the `archiveList` tag to display the latest article list on the AnQiCMS homepage?

On AnQiCMS, the homepage is often the first window visitors use to understand the website's content.How to efficiently and dynamically display the latest articles to attract visitors to continue browsing is the key to content operation.AnQiCMS provides a flexible and easy-to-use template tag system, where the `archiveList` tag is the core tool to achieve this goal.

2025-11-07

How to customize variables and assign values using (with/set) in AnQiCMS templates?

In AnQiCMS templates, flexibly customizing and using variables is the key to achieving dynamic content and efficient template reuse.AnQiCMS's template syntax borrows the characteristics of popular template engines such as Django and Blade, making variable definition and assignment intuitive and powerful.This article will deeply explore the `with` and `set` tags, helping you to better customize variables and utilize them in AnQiCMS templates.### One, the foundation of variable customization: Understanding the core of template syntax In AnQiCMS template

2025-11-07

How to display the current time and formatted timestamp in AnQiCMS template?

Displaying time on the website content, whether it is the publication date of the article, the update time of the product, or the real-time loading time of the page, can greatly enhance the user experience and the timeliness of information.AnQiCMS is a content management system developed based on the Go language, which is very intuitive and flexible in handling time and dates in templates.This article will introduce you to how to display the current time and formatted stored timestamp in AnQiCMS templates.

2025-11-07

How to display the link to the previous and next article on the AnQiCMS article detail page?

To add links to the previous and next articles on the article detail page in AnQi CMS is a very practical feature for enhancing user reading experience and the internal link structure of the website.AnQiCMS's powerful template tag system makes this feature intuitive and efficient.

2025-11-07

How to use the `userDetail` tag to obtain and display the ID information of a specified user?

AnQiCMS with its flexible and powerful template tag system makes the display of website content very convenient.Whether it is articles, products, or user information, they can be easily displayed on the page with simple tags.Today, let's talk about how to use the `userDetail` tag to accurately obtain and display the ID information of a specified user.

2025-11-07

How to correctly display the user's `UserName` (username) in the AnQiCMS template?

In AnQiCMS templates, flexibly displaying user information is a key link to enhance website personalization and user experience.Whether it is to display the nickname of the comment author or to show the detailed information of the registered user on a specific page, it is very important to understand how to correctly call `UserName`. AnQiCMS's powerful template engine provides multiple ways to achieve this goal, and we will delve deeper into these methods next.AnQiCMS's template system adopts a syntax similar to the Django template engine, which allows developers to quickly build pages in a concise and efficient manner

2025-11-07

How to use the `userDetail` tag to retrieve the user's real name `RealName` on the frontend page?

In website operations, personalization and user experience are the key to enhancing brand image.Sometimes, we are not satisfied with just displaying the user's nickname or avatar. In certain scenarios, such as the member center, profile page, or some activity leaderboard, we may also need to display the user's real name.AnQi CMS is a highly flexible and feature-rich Go language content management system that provides intuitive template tags, allowing front-end developers to easily retrieve and display this information.Today, let's delve into how to use the `userDetail` tag of Anqi CMS

2025-11-07