How is the `images` field (document group image) stored and parsed in the document details?

Calendar 👁️ 70

When using AnQiCMS to manage website content, images are undoubtedly an important element in enhancing the attractiveness of the content, especially when we want to add a series of related images to the document. The album function is particularly crucial in this case. So, in the document details of AnQiCMS, these albums (that is,imagesHow is the field stored and parsed? Understanding this will help us better utilize AnQiCMS for content creation and display.

The storage mechanism of document group images

First, when we obtain the document details through the AnQiCMS interface (such as calling/api/archive/detailinterface) at the time, the returned data will contain a field namedimagesThe field is explicitly annotated with the typestring[]This indicates that it is a string array, where each string represents the complete access address (URL) of an image.

This means that AnQiCMS does not store the image files themselves in the document records, but stores the links to these images.This design is very flexible, it decouples the management of image resources from document content, and images can be stored centrally on CDN or other file services, thereby optimizing loading speed and management efficiency.

It is especially worth mentioning that in most cases, the main image or thumbnail (correspondinglogoandthumbfield) is thisimagesThe first image in the array. When AnQiCMS processes internally, it intelligently selects the first image in the group image array as the visual identifier for the document, used for list display or other places where a single image is needed.

the addition and management of the group image

How are these groups of images added to the document? When we publish the document interface/api/archive/publish), or import the document interface/api/import/archive, the same is used to create or update contentimagesThis field.

At this time, we need to pass the pre-uploaded image links as a string array toimagesfield. For example, we can provide["https://en.anqicms.com/uploads/arc1.png", "https://en.anqicms.com/uploads/arc2.png"]Such a structure. AnQiCMS is designed to allow us to set up to 9 group images for each document, and the first image in the array is automatically recognized by the system as the cover image or main image of the document, as we can see when we get the document details.

Where do these image URLs come from? They are usually obtained through the attachment upload interface (/api/attachment/upload) after uploading and become permanent links. The attachment upload interface returns thelogo(original image link) andthumb(Thumbnail link), we can choose to use any one of them as the member link of the group image.This separates the handling of image files and document data, making image management more flexible and efficient, you can upload images first, and then integrate the links into the document group image.

The analysis of a group image and front-end display

When displaying on the front end, obtain the document detailsimagesAfter the field, we get an array containing multiple image URLs.Front-end developers can easily iterate through this array, render each image onto the page, and thus build beautiful image galleries, sliders, or waterfall effects and more visual presentations.

For example, on a product detail page,imagesThe images in the array can constitute a product album, where users can swipe left and right or click to view a larger image.And on an article detail page, these group photos can serve as a supplement to the article content, enhancing visual appeal.This design not only makes it convenient for content creators to manage multiple images, but also provides great flexibility for front-end developers, who can flexibly call and display these images according to different page layouts and design requirements, without concerning about the specific storage details of the image files.

Frequently Asked Questions (FAQ)

  1. Question: If my document only has one image,imagesWhat will the field be in form?Answer: Even if the document only has one image,imagesthe field will still return a string array containing a single URL. For example,["https://example.com/single_image.jpg"]. At the same time,logoandthumbThe field usually points to this unique image URL for direct reference.

  2. Question:images/logoandthumbWhat are the differences and relationships between these fields?Answer:imagesis an array of strings that contains all the group image URLs in the document. Andlogoandthumbis a single string representing the original and thumbnail image URLs of the document. Usuallylogoandthumbthe images are sourced fromimagesThe first image in the array.imagesUsed to display a multi-image scene, whilelogoandthumbIt is more commonly used on list pages, sharing thumbnails, or as the main visual identifier for documents.

  3. Question: How can I ensure that the images I uploadimagesThe order in the array?Answer: When you submit through the publish interfaceimagesthe field, the order of the image URL is the same as its order in the array. For example, when you submitimages: ['url1', 'url2', 'url3']Then when retrieving document details, returned theimagesThe array will also be in this order. Therefore, you can control the display order of the group image by adjusting the order of the URLs submitted, and the first URL will also be recognized aslogoandthumbsource.

Related articles

How to get the current view count (`views`) and comment count (`comment_count`) of the document?

When operating a website, understanding which content is more popular and which topics can spark discussion is crucial for optimizing content strategy.AnQiCMS (AnQiCMS) provides us with a convenient way to obtain this key data, such as the number of page views and comments on articles.Let's take a detailed look at how to obtain this information through the Anqi CMS API interface.

2025-11-09

What do the `module_id` and `category_id` fields represent in the document details, and can you further query model or category details through them?

## Unveiling the details of Anqi CMS document `module_id` and `category_id`: What do they mean?When using AnQi CMS for content management and website operation, we often obtain various data through API interfaces, among which the document detail interface (`/api/archive/detail`) is the key to obtaining the core information of a single article.In the returned data of this interface, you may notice the `module_id` and `category_id` fields.

2025-11-09

What role does the `url_token` field play in the document details, and how is it associated with the `filename` parameter?

In the daily use of Anqi CMS, we often encounter the `url_token` field, especially when dealing with document details and URL structures.It is closely related to the `filename` parameter in the API interface. Understanding the relationship between the two is crucial for better management of website content, optimizing user experience, and improving search engine performance.### `url_token`:The "friendly" identity tag of content `url_token` is simply the term used in the AnQi CMS system for various types of content (such as documents

2025-11-09

How to get the SEO title (`seo_title`), keywords (`keywords`), and description (`description`) of a document?

In website operation, setting clear and targeted SEO titles (`seo_title`), keywords (`keywords`), and descriptions (`description`) is a key step in improving search engine rankings.AnQiCMS (AnQiCMS) provides a convenient way to manage and obtain these important SEO metadata.Whether you need to dynamically set this information for a single page or process a large amount of content in bulk, it can be easily achieved through the provided API interface.

2025-11-09

What do the `logo` and `thumb` fields represent in the document details, and what is the difference between them?

When managing content in Anqi CMS, we often encounter questions about image fields, especially the `logo` and `thumb` fields, which are both involved in image representation in the document detail interface (`archiveDetail`), but have subtle yet important differences in actual use and meaning.Understanding their differences can help us better optimize the visual presentation and loading performance of the website.### `logo` field: the "identity card" of the document When we talk about the `logo` field

2025-11-09

How to interpret the `flag` recommended attribute in the document details, for example, what do `h`, `c`, `f`, and others represent?

In AnQi CMS, the recommended attribute `flag` is a very practical feature in content operations. It allows us to classify and label document content, thereby enabling personalized display and filtering in different areas of the website.Understanding the meaning of these brief letter codes can help us manage and present website content more efficiently.Where can I find the `Flag` attribute? This important `flag` attribute appears in several key interfaces, it is both the characteristic of the document itself, and the important basis for querying and filtering documents. First

2025-11-09

What is the role of `canonical_url` and `fixed_link` in document details for SEO and link management?

In website operation, the health status of links and the friendliness to search engines are the foundation for the success of the website.AnQi CMS provides us with two key fields: `canonical_url` and `fixed_link`, which play a crucial role in document details and help us optimize the search engine performance of the website and effectively manage links. ### canonical_url: Define the "main version" of the content Imagine that your website might have multiple URLs pointing to the same or highly similar content for various reasons.

2025-11-09

Is the `created_time` and `updated_time` field of the document in Unix timestamp, how to perform time format conversion?

In AnQiCMS (AnQiCMS), when you obtain various information such as documents, categories, attachments, and users through the API interface, you will find that fields like `created_time` (creation time) and `updated_time` (update time) are usually presented in integer form.This is indeed the Unix timestamp format commonly used by many systems, including AnQiCMS.### What is Unix timestamp? Unix timestamp, also known as POSIX time or Epoch time, is a way to represent time

2025-11-09