How to display the cover image, thumbnail, or multiple image sets of the document in Anqi CMS?

Calendar 👁️ 69

How to display the cover image, thumbnail, or multiple image sets of documents in AnQi CMS is a concern for many operators.A visually appealing website cannot do without beautifully arranged pictures.The Anqi CMS provides very flexible and powerful features in this aspect, whether it is to set an eye-catching cover image for an article, automatically generate thumbnails for list display, or build a rich multi-image album, it can be easily achieved.

1. Basic settings and intelligent processing of document images

When we add or edit documents on the Anqi CMS backend, we will find several key settings related to images, which together form the foundation for the display of document images.

The first is the quotation markDocument ImageThe field is usually used to upload a document thumbnail. If you upload an image, it will become the main thumbnail of the document.But even if you do not upload manually, Anqi CMS is smart enough: if the document content contains images, the system will automatically extract the first image as the document thumbnail.This greatly simplifies the daily release process, reducing repetitive operations.

In addition to manual upload, Anqi CMS is stillGlobal settings "Content Settings"Options for more refined image processing are provided, allowing you to adjust according to the overall style and performance needs of the website:

  • Thumbnail processing method and size:You can define whether the thumbnail is scaled proportionally to the longest side, padded to the longest side (the insufficient part of the image is filled with white), or cropped to the shortest side.At the same time, it can set a unified thumbnail size to ensure the consistency of the website's visual style.
  • Default thumbnail: If the document does not upload any images and there are no images in the content, the system can call the default thumbnail you have set to avoid blank spaces appearing on the page.
  • WebP image format and automatic compression:To optimize the website loading speed and save storage space, you can choose to enable WebP image format conversion and automatic compression of large images.After enabling, uploaded images will be automatically converted and compressed to the specified width, and these processes are all done automatically in the background.
  • Batch regenerate thumbnails:If you modify the thumbnail processing method or size, you do not need to re-upload them one by one. Anqicms provides the "batch regenerate thumbnails" function, one click can update thumbnails throughout the site, very convenient.

These backend settings ensure that no matter where the image comes from, it can be presented in the most suitable way for the website.

Secondly, flexibly display images on the document details page.

On the detailed content page of the document, we usually need to display the most complete image information, which may be a large, impressive cover image, or a set of detailed multi-images. Anqi CMS througharchiveDetailLabel, let us easily call these images.

  • Call the cover logo (Logo): LogoIt usually refers to the main cover image of a document. In the document detail page, you can directly go through{{archive.Logo}}or use{% archiveDetail with name="Logo" %}Label to retrieve and display it. This image is usually used at the top of the page, leaving a first impression on the user.

    {# 示例:展示文档封面首图 #}
    <div class="document-cover">
        <img src="{% archiveDetail with name='Logo' %}" alt="{% archiveDetail with name='Title' %}" />
    </div>
    
  • Call thumbnail (Thumb):Although not commonly used on detail pages, butThumbThe field is still available, it provides a thumbnail version processed by the background settings. If your detail page layout needs a smaller image, you can directly call:

    {# 示例:展示文档缩略图(如果需要) #}
    <div class="document-thumb">
        <img src="{% archiveDetail with name='Thumb' %}" alt="{% archiveDetail with name='Title' %}" />
    </div>
    
  • Display multiple image sets (Images):When a document needs to display a set of images, such as product multi-angle display, event photo album, etc.,ImagesThe field comes into play. This is an array that contains the addresses of multiple images, and you can iterate through them one by one.

    {# 示例:展示文档内置的多图集 #}
    <div class="document-gallery">
        {% archiveDetail archiveImages with name="Images" %}
        {% for imgUrl in archiveImages %}
            <img src="{{ imgUrl }}" alt="图片描述" />
        {% endfor %}
        {% endarchiveDetail %}
    </div>
    
  • Achieve more flexible multi-image sets through custom fields:The Anqi CMS content model supports custom fields, if you want a more personalized image set, you can add a custom field of the type "multi-image set" (for example, named in the background for the document model, you can add a custom field of the type "multi-image set" (for example, namedproduct_gallery)。In the document detail page, you can get the value of this custom field byarchiveDetaillabel, which is also an image URL array, and then display it in a loop:

    {# 示例:展示通过自定义字段实现的图集(假设自定义字段名为product_gallery) #}
    <div class="product-gallery">
        {% archiveDetail customGallery with name="product_gallery" %}
        {% for img in customGallery %}
            <img src="{{ img }}" alt="产品详情图" />
        {% endfor %}
        {% endarchiveDetail %}
    </div>
    

Chapter 3, display images simply on the document list page

On article lists, product lists, and other pages, images usually appear in the form of thumbnails, which can attract users and maintain the page's neatness and loading speed.archiveListThe tag is the main character here, it helps us batch retrieve document data and display the thumbnail of each document in a loop.

InarchiveListIn the loop, each document itemitemwill includeLogoandThumbField, you can choose to use according to your design requirements:

"`twig {# Example: Display thumbnails in the document list #}

    {% archiveList archives with type="page" limit="10" %}
    {% for item in archives %}
    <li class="document-item">
        <a href="{{item.Link}}">
            <div class="item-image">
                {% if item.Thumb %} {# 优先使用缩略图 #}
                    <img src="{{item.Thumb}}" alt="{{item.Title}}" />
                {% elif item.Logo %} {# 如果没有缩略图,则使用封面首图 #}
                    <img src="{{item.Logo}}"
    

Related articles

How to get the title list (H1-H6) of document content for generating catalog navigation?

In the daily operation of websites, we often encounter long-form content, such as tutorials, product descriptions, or in-depth analysis articles.It is particularly important to add a clear table of contents to the article at this point (usually located in the sidebar or at the top of the article).It can not only help visitors quickly understand the structure of the article, jump directly to the part of interest, but also improve the page SEO performance, enhance the user experience.In AnQiCMS (AnQiCMS), implementing this feature is actually simpler than you imagine, thanks to a very practical template tag provided by the system.

2025-11-08

How can AnQi CMS enable lazy loading display for images in document content?

In today's online environment, the loading speed of a website is one of the key factors in user experience and search engine ranking.When web page content includes a large number of images, these images often become the 'culprits' that slow down loading speed.Imagine a user opening a page, even if they haven't scrolled to the bottom of the page, the browser has already started downloading all the images, which undoubtedly consumes valuable bandwidth and processing resources, resulting in slow page response.In order to solve this pain point, the Lazy Loading technology for images was born.

2025-11-08

How to retrieve and display the complete content and all fields of a single document?

One of the core values of a content management system is the ability to flexibly define and present various types of content.For users of AnQiCMS, whether it is to display a detailed article, a product page, or a custom data entry, how to efficiently obtain its complete content and all associated fields is the key to front-end template development and content presentation.Today, let's delve into how to easily control the acquisition and display of individual document content in AnQiCMS using this '万能钥匙' template tag.

2025-11-08

How to achieve accurate display of in-site search results in Aiqi CMS?

The importance of on-site search functionality in daily website operation is self-evident.It is not only a bridge for users to quickly find the information they need, but also a key link to improve user experience, extend visit duration, and even promote conversion.If a user enters a keyword and gets a bunch of irrelevant results, they are likely to leave quickly.Therefore, how to achieve accurate display of in-site search results in AnQiCMS is a topic that every content operator should delve into.AnQiCMS is a system specially designed for content management, with a powerful and flexible search mechanism and content organization capabilities

2025-11-08

How to display the publish time, update time, view count, and category of the document?

In AnQiCMS, flexibly displaying content is one of its core advantages, which not only concerns the user experience but also directly affects the website's SEO performance.The document's publication time, update time, view count, and category information are often the focus of users and important indicators for search engines to evaluate the timeliness and relevance of content.It's good that AnQiCMS provides us with intuitive and powerful template tags, making the display of this information very simple.

2025-11-08

How to retrieve and display the Tag list associated with the document in AnQi CMS?

The AnQi CMS provides a flexible and powerful Tag feature in content management, which can not only help you better organize content but also effectively improve the website's SEO performance and user experience.This article will introduce how to manage and retrieve the Tag tag list associated with documents in Anqi CMS and display it on your website front-end. ### Backend Tag Management: Effective Classification and Association Tag management in Anqi CMS is intuitive and convenient.You can find the 'Document Tag' feature under the 'Content Management' menu in the background.

2025-11-08

How to display the links to the previous and next documents on the document detail page?

In website operation, providing a smooth user experience is crucial, and the previous and next navigation on the document detail page is the key to improving user experience and guiding users to deeply browse the website content.In AnQiCMS (AnQi CMS), implementing this feature is simple and efficient, it comes with dedicated template tags that allow you to easily add this practical feature to your website content. ### The Importance of Navigation Between Articles After users finish reading a document, they often want to find related or the next article to get more information.

2025-11-08

How to retrieve and display the custom parameter fields of the document in Anqi CMS?

AnQi CMS is loved by content operators for its excellent flexibility and highly customizable nature.In daily website management, we often encounter scenarios where it is necessary to add exclusive attributes for different types of content (such as articles, products, events, etc.)At this time, the document custom parameter field function of Anqi CMS can fully display its strength, allowing us to expand the structure of content according to business needs, thus achieving more personalized and rich display effects.

2025-11-08