How to display the cover image (Logo) and thumbnail (Thumb) of an AnQi CMS article?

Calendar 👁️ 77

In content operation, the cover image (Logo) and thumbnail (Thumb) of the article play a crucial role. They not only attract the reader's attention and increase the click-through rate, but are also an indispensable part of search engine optimization (SEO).AnQiCMS (AnQiCMS) provides users with a flexible and convenient way to manage and display these visual elements.This article will discuss in detail how to configure and call the cover image and thumbnail of the article in AnQiCMS.

1. Configuration and generation of cover image and thumbnail

In AnQiCMS, the settings for cover images and thumbnails are divided into manual configuration at the time of article publication and global processing rules at the system level.

1. Article publication and intelligent extraction

When you write or edit an article, you can find the "Document Image" area in the "Add Document" or "Edit Document" interface in the background.

  • Manual upload and select: Here you can upload a brand new image as the thumbnail of the article, or select one from the existing image library.This approach provides the highest flexibility, you can carefully select the most suitable image for each article.
  • Intelligent automatic extraction:If you have not manually uploaded or selected a thumbnail, but the article content contains images, AnQiCMS will intelligently extract the first image from the article content as the thumbnail for the document.This feature greatly reduces the workload of content creators, ensuring that even if the upload is forgotten, the article can have a default visual display.

2. Global thumbnail processing settings

AnQiCMS provides powerful global content settings, allowing you to unify the management of website image generation methods to ensure consistency in visual style.

  • Access path:You can configure these options by accessing the "Global Settings" -> "Content Settings" in the backend.
  • Thumbnail processing method:The system provides multiple thumbnail generation methods to meet different design needs, such as:
    • Scale proportionally to the longest side:Maintain the image ratio to fit the target size, may leave white space.
    • Pad to the longest edge:Fill the image completely to the target size, and fill the insufficient part with white.
    • Trim to the shortest edge:Automatically center-crop to ensure the image completely covers the target size, which may result in the loss of edge content.
  • Thumbnail size:You can set a default thumbnail size, for example, 200x150 pixels.When the image is uploaded or a thumbnail is generated, the system will process it according to this size and the processing method you choose.
  • Default thumbnail: If an article does not have a manually set thumbnail and there are no images to extract from the content, AnQiCMS allows you to set a 'default thumbnail' as a last resort.
  • Batch regenerate: After you modify the global thumbnail size or processing method, the system provides the "batch regenerate thumbnails" feature, which can quickly update all existing thumbnails on the website to ensure they meet the new settings.

With these configurations, AnQiCMS ensures that the cover image and thumbnail of the article have a clear source and a flexible generation mechanism in the background.

Two, call the article cover image and thumbnail in the template

After configuring the cover image and thumbnail, how to display them in the front-end template is the key to achieving the final effect.AnQiCMS provides intuitive template tags, making this process simple.

1. Call in the document detail page

In the page displaying a single article's content (usually the article detail page), you can usearchiveDetailTag to get the detailed information of the current article, including its cover image and thumbnail.

  • Example of getting the cover image (Logo):Cover image usually refers to the main illustration of an article, which is sometimes also used as the large image on the list page.archiveDetailTagged,name="Logo"It will return the URL of the article cover image.

    <img src="{% archiveDetail with name="Logo" %}" alt="{% archiveDetail with name="Title" %}" />
    
  • Example of getting thumbnail (Thumb):Thumbnail is usually a smaller image cropped or scaled, suitable for list display.name="Thumb"It will return the URL of the article thumbnail.

    <img src="{% archiveDetail with name="Thumb" %}" alt="{% archiveDetail with name="Title" %}" />
    

2. Article list page call

When you need to display a list of multiple articles on a page (such as the homepage, category list page), you can usearchiveListTag for loop calling. Inside the loop body, each article's data object (such asitem) includes the URL of its cover image and thumbnail.

  • Loop calling example:

    {% archiveList archives with type="list" limit="5" %}
        {% for item in archives %}
            <div>
                <a href="{{ item.Link }}">
                    {# 显示文章缩略图 #}
                    <img src="{{ item.Thumb }}" alt="{{ item.Title }}" />
                    <h3>{{ item.Title }}</h3>
                    <p>{{ item.Description }}</p>
                </a>
            </div>
        {% endfor %}
    {% endarchiveList %}
    

    here,item.Thumbanditem.LogoYou can directly obtain the URL of the thumbnail and cover image corresponding to the article.

3. Other types of page visual elements

In addition to articles, the category page and single page of AnQiCMS also support similar visual element calls:

  • Category page:In the category detail page or category list, you cancategoryDetailorcategoryListuse tags,name="Logo"orname="Thumb"Get the cover image or thumbnail of the category. For example, the category may have special pictures or icons.
  • Single page:For single-page pages like "About Us", pageDetailorpageListLabels also providedname="Logo"orname="Thumb"Field used to display the visual identification of the page.

3. Dynamic thumbnail processing (thumbFilter)

AnQiCMS also provides a very practicalthumbA filter that allows you to dynamically create thumbnail images for any image URL in the template without pre-generating them.This means you can flexibly adjust the size of the image according to the actual needs of the frontend layout.

  • Usage scenario:Assuming you need a specific size (such as 100 pixels wide) thumbnail in some layout, but the system-generated thumbnail size does not meet the requirements. You can usethumbA filter to dynamically generate images of that size.

  • The calling method:Just pass the image URL through a pipe symbol|pass tothumband use the filter. For example:

    <img src="{{ item.Logo|thumb:100 }}" alt="{{ item.Title }}" />
    

    Here100Indicates that the image width should be 100 pixels, and the height will be automatically scaled proportionally. You can also specify100x80to define specific width and height.

By using the above method, you can fully control the configuration, generation, and display of cover images and thumbnails for articles (and other content types) in AnQiCMS, thereby bringing richer visual effects and a better user experience to your website.


Frequently Asked Questions (FAQ)

  1. Will the image in the article content automatically become a thumbnail if I haven't uploaded it manually?Yes, if you do not manually upload or select a thumbnail when publishing an article, but the article content contains images, AnQiCMS will intelligently extract the first image in the content as the default thumbnail for the article.

  2. Can I set different thumbnail sizes for different article lists (such as the homepage list and sidebar recommendations)?Of course you can. Although AnQiCMS has global thumbnail generation settings, you can use it at the template level.thumbThe filter dynamically processes any image URL. For example, the home page list can be called{{ item.Thumb }}(using the globally set thumbnail), while the sidebar recommendations can be called{{ item.Logo|thumb:80x60 }}Generate a 80x60 pixel thumbnail to accommodate different layout requirements.

  3. What is the difference between the 'website LOGO' and the 'cover image (Logo)' of AnQiCMS?The 'website LOGO' usually refers to the overall brand of your website.

Related articles

How to generate the catalog navigation on the front page for the automatic extraction of article content (`ContentTitles`) feature?

In Anqi CMS, providing a clear directory navigation to help readers better understand the structure of long articles is the key to improving user experience.The Anqi CMS article content automatically extracts the title (ContentTitles) feature, which is for this purpose.It can intelligently identify the various titles in the article content and provide this structured information to the front-end template, making it easy for us to build a dynamic and practical directory navigation.###

2025-11-09

How to implement lazy loading of images in the `archiveDetail` tag of AnQi CMS?

In today's content is king era, the importance of website performance and user experience is self-evident.Especially for content pages with many images, how to avoid affecting user experience and search engine rankings due to slow image loading has become a common concern for website operators.AnQi CMS is well-versed in this, not only providing flexible and efficient content management functions, but also cleverly supporting image lazy loading (Lazy Load).

2025-11-09

How to display and truncate the Description field of AnQi CMS on the front page?

In the daily operation of AnQi CMS, the Description field plays a crucial role, not only affecting how search engines understand the page content, but also being the key copy that attracts users to click.Understand how this field displays and flexibly truncates on the front-end page, which can help us better perform content layout and SEO optimization. ### Description of field in various aspects and functions In AnQi CMS, the "description" field is not a single concept. It will show different forms and functions according to the content type and usage scenario. The most common and has the greatest impact on SEO

2025-11-09

How to implement SEO optimization display of article titles in Anqi CMS and differentiate them from regular titles?

How to implement SEO optimization display of article titles in AnQiCMS, distinguishing from the regular title?In the practice of content operation, we often face a challenge: how to balance the 'readability' of content with 'search engine friendliness'.A captivating title can catch the reader's attention and increase click-through rate;A title containing core keywords can help search engines better understand the content and improve rankings.AnQiCMS fully understands the importance of this requirement and therefore provides a flexible mechanism

2025-11-09

How to display the publication time of articles in Anqi CMS and customize the date and time format?

When operating website content, the publication time of the article is an indispensable element.It not only helps visitors quickly understand the "freshness" of the content, but also has a positive impact on search engine optimization (SEO), as it conveys the signal that the website content is continuously updated.AnQiCMS provides great flexibility in content management, whether it is to obtain or customize the display time of published articles, it is very convenient.Next, we will explore how to flexibly display the publication time of articles in Anqi CMS

2025-11-09

How to display the category information of the articles on the front page of AnQi CMS, including the category name and link?

In Anqi CMS, the display of article category information on the front page is a key link in content organization and user navigation.Whether it is to help users understand the context of the article or to optimize the website's SEO structure, accurate and accessible category names and links play an important role.AnQi CMS with its flexible template engine makes this task intuitive and efficient.Understanding Anqi CMS's Classification System Before delving into the display methods, we first need to know that Anqi CMS's content management system attaches great importance to the concept of 'classification'.Each document (whether it is an article

2025-11-09

How to use the `tagList` tag to display the associated tag list on the article detail page?

In content operation, tags (Tags) are a very practical tool that can help us organize content more flexibly, making it convenient for readers to quickly find related topics of interest.Imagine that after a user reads an excellent article, if they can immediately see other popular topics or keywords related to that article, it will undoubtedly greatly enhance their browsing experience and encourage them to explore other content on the website.In Anqi CMS, implementing this feature is very intuitive and simple, we mainly rely on the powerful `tagList` tag to complete it.

2025-11-09

How to display custom fields (such as author, source) of AnQi CMS documents on the front-end page?

When managing content in Anqi CMS, we often encounter the need to add more personalized data to articles, products, or pages, such as the author of the article, the source of content, or specific parameters of products, or specific attributes of event pages, etc.This additional customization information is called "custom field".The powerful content model function of AnQi CMS makes it very convenient to create and manage custom fields, and more importantly, how to accurately and beautifully present these meticulously entered custom fields on the front page of the website

2025-11-09