How does Anqi CMS display the cover image and thumbnail of the document?

Calendar 👁️ 58

As an experienced website operations expert, I am well aware of the importance of a high-quality cover image and an appropriate thumbnail for the attractiveness of the website, user experience, and even search engine optimization (SEO).AnQiCMS (AnQiCMS) is well-versed in this field, its design in image processing and display is not only powerful but also takes into account the ease of operation and the flexibility of display.

Next, let's delve into how Anqi CMS cleverly displays the cover images and thumbnails of documents.


1. Background image management: from intelligent upload to global optimization

The Anqi CMS provides a complete solution for operators in image management, from content entry to global configuration, ensuring efficient and intelligent image processing.

1. Image intelligent processing during content entry

When you publish articles, products, or create single pages through Anqi CMS, uploading images is not just simple storage, the system provides multiple intelligent assists.For example, in the "Add Document" interface, you can manually select an image from the uploaded image library as the document thumbnail, or directly upload a new image.If the operator does not specifically upload a thumbnail, but the document content contains images, Anqi CMS will use its intelligent features to automatically extract the first image in the document content as the thumbnail for the document.This thoughtful design greatly simplifies the process of content publishing, reducing manual operations.

For categories and single pages, Anqi CMS also provides options to upload cover images (Logo), thumbnails (Thumb), and multiple banner images (Images) to display richer visual content in different scenarios.This means that whether it is the concise thumbnail on the list page, or the exquisite cover on the detail page, or even the Banner carousel, they can all be properly managed.

2. Global content image settings and optimization

The strength of AnQi CMS also lies in the global image optimization options provided in its "Content Settings". This is not just simple upload, but also a series of intelligent optimization features that work silently for you, ensuring that images are loaded as quickly as possible while maintaining quality and optimizing SEO:

  • WebP image format conversion:Considering the advantages of WebP format in terms of volume and loading speed, Anqi CMS allows enabling the function to automatically convert uploaded JPG, PNG images to WebP format.This is crucial for improving the overall performance of the website.
  • Large image automatically compressed:To prevent large image files from slowing down the website speed, the system supports automatic compression of large images and can be customized to compress to a specified width.This greatly reduces the storage space and transmission bandwidth of the image without affecting the visual effect.
  • Thumbnail processing method:For thumbnail generation, Anqi CMS provides three fine processing modes:
    • Scale proportionally to the longest side:Display all edges of the image completely, maintaining the image ratio.
    • Pad to the longest edge:Width and height are fixed, the image is centered, and the unused part is filled with white.
    • Trim to the shortest edge:Center-crop the image to ensure that the shortest edge is fully displayed, but part of the longest edge may be cropped off. Operator can flexibly choose the most suitable thumbnail generation strategy according to template design and visual requirements.
  • Custom thumbnail size:The operator can customize the specific size of the thumbnail according to the actual needs of the front-end page to adapt to different display areas and ensure the display effect of the image.
  • Default thumbnail: This is a practical fallback option. If the document does not upload a thumbnail, the system will use the preset default thumbnail for display to avoid blank images affecting the page aesthetics.
  • Batch regenerate thumbnails:When the thumbnail size or processing method changes, Anqi CMS provides the function to batch regenerate all thumbnails, greatly reducing maintenance costs.

Second, the magic in the template: various ways to call images

The AnQi CMS template engine is based on Go language, with syntax similar to Django, making the call of images on the front-end intuitive and flexible through concise tags and variables.

1. Basic Template Tags

In AnQi CMS template files, variables are enclosed in double curly braces{{变量}}defined, while conditional judgment, loop control, and other logical tags use single curly braces and percentage signs{% 标签 %}Definition. Understanding this basic syntax is the key to flexibly invoking images.

2. Invoking images for different content types

Anqi CMS for documents (archive)、Category(category)、Single page(page) and tags (tag)Provided with an independent detail tag, and built-in fields for calling cover and thumbnail images:“

  • Document detail page(archiveDetail):
    • {{archive.Logo}}:Generally used to call the cover large image or main image of the document。
    • {{archive.Thumb}}: Used to call the document thumbnail, commonly used for list display or small preview.
    • {% archiveDetail archiveImages with name="Images" %}: Used to retrieve multiple images uploaded with the document (such as product albums), and it needs to be accessed throughforLoop througharchiveImagesDisplay each image.
  • Category details page (categoryDetail):
    • {{category.Logo}}: Call the large category image, often used as the main visual element of the category page.
    • {{category.Thumb}}: Call the category thumbnail, which may be used in the parent category list or some special layouts.
    • {% categoryDetail categoryImages with name="Images" %}: Used to obtain the category Banner group image, which also needs to be displayed in a loop.
  • Single page detail page (pageDetail):
    • {{page.Logo}}: Call the large image of the single page.
    • {{page.Thumb}}: Call the thumbnail of the single page.
    • {% pageDetail pageImages with name="Images" %}: Used to get the slide group image of the single page.
  • Tag detail page (tagDetail):
    • {{tag.Logo}}: Mainly used to call the main image of the tag page.

These tags can be used directly on the detail page{{archive.Logo}}or{{category.Thumb}}This format can be used on the list page as well, by loopingarchiveList/categoryList/pageListwhen using tags, by{{item.Logo}}or{{item.Thumb}}to call the image of each list item.

Example code snippet (for document list):

{% archiveList archives with type="page" limit="10" %}
    {% for item in archives %}
    <div class="article-item">
        <a href="{{item.Link}}">
            {% if item.Thumb %} {# 判断是否存在缩略图 #}
            <img class="article-thumb" src="{{item.Thumb}}" alt="{{item.Title}}">
            {% endif %}
            <h3 class="article-title">{{item.Title}}</h3>
            <p class="article-desc">{{item.Description}}</p>
        </a>
    </div>
    {% endfor %}
{% endarchiveList %}

3. Image lazy loading optimization in the content editor:

For the images inserted in the document body, Anqi CMS also considers performance optimization. When calling the document content ("

Related articles

How to set and call the recommended attribute (Flag) of the document in AnQiCMS?

## AnQiCMS High-efficiency Operation Manual: Mastering the Settings and Calls of Document Recommendation Attributes (Flag) As an experienced website operations expert, I am well aware that how to make your high-quality content stand out in the vast sea of digital content and accurately reach your target users is the key to success.AnQiCMS as a powerful content management system, its built-in "Flag" feature is a powerful tool to help content achieve fine-grained operation.It can not only help you flexibly organize and display content, but also effectively enhance the exposure and user perception of the content. Today

2025-11-06

How to call and display the views (Views) of Anqi CMS documents?

As an experienced website operations expert, I know that every data indicator contains a profound insight into the performance of website content and user behavior.In AnQiCMS (AnQiCMS) such an efficient and practical content management system, the flexible invocation and display of core data such as 'Document Views' is an indispensable ability for content operators.This not only helps us understand the content popularity intuitively, but is also an important basis for optimizing content strategy and improving user experience.

2025-11-06

How to get the ID and name of the current document category?

In the daily operation of AnQi CMS, content classification is a key element for organizing information, enhancing user experience, and optimizing SEO.Whether it is to generate breadcrumb navigation for articles, or to display other content under the current category in the sidebar, or to set dynamic titles for category pages, obtaining the ID and name of the current document's category is a common requirement in template development.The Anqi CMS provides intuitive and powerful template tags, allowing you to easily call this information on the front-end page.

2025-11-06

How to extract and display the list of hierarchical titles (H1-H6) in the AnQiCMS document content?

## Mastering the Ride: AnQiCMS How to Intelligently Extract and Display Hierarchical Titles (H1-H6) As an experienced website operations expert, I deeply understand the importance of content structure for user experience and search engine optimization.When dealing with a large amount of document content, it is crucial to clearly understand and efficiently utilize the hierarchical title structure (H1-H6) within the document to enhance the value of the website content.AnQiCMS (AnQiCMS) is an efficient enterprise-level content management system that provides very intuitive and powerful functions in this aspect.

2025-11-06

How to display multiple cover group images in a document detail page?

As an expert who deeply understands website operation, I know that high-quality, visually appealing content is the key to retaining users and enhancing the value of the website.AnQiCMS (AnQiCMS) is a powerful content management system that provides great flexibility in content presentation.Today, let's delve into a common need: how to cleverly loop multiple cover group images on the document detail page to make the content more expressive. --- ## Secure CMS: Delicate Presentation!A guide to displaying multiple cover group images in document detail pages In the era of content is king

2025-11-06

How to format the display of the release and update time of AnQiCMS documents?

As an experienced website operations expert, I am well aware that the accuracy and readability of time in content display are crucial for user experience and Search Engine Optimization (SEO).AnQiCMS as an efficient and flexible content management system provides a very convenient way to control the display format of the publication and update time of articles.This article will focus on how AnQiCMS formats and displays the publication and update times of documents, and will explain the secrets and practical skills in detail.

2025-11-06

How to obtain all the details of the category owned by the document details page?

How to retrieve all detailed information of the category owned by the document detail page of Anqi CMS?In website content operations, the document detail page is not just for displaying articles or products, it often needs to establish a connection with a broader content system, such as displaying detailed information about its category.This not only enhances the user experience, guides users to discover more related content, but also helps improve the internal link structure and SEO performance of the website.As an experienced website operation expert, I deeply understand the strength and flexibility of AnQiCMS (AnQiCMS) in dealing with such needs.

2025-11-06

How to call custom document fields (such as author, price) and display them in AnQi CMS?

AnQi CMS offers powerful content management capabilities with its excellent flexibility and customizability to website operators.In the daily operation of websites, we often encounter situations where standard fields (such as titles, content, and publication time) cannot fully meet the needs of specific content display.At this moment, custom document fields have become our powerful assistants, for example, adding "author" information to an article, or supplementing "price" attributes to a product, and so on.How can we flexibly call these custom fields and display them on the website page in Anqi CMS today?

2025-11-06