How to set up category Banner image and thumbnail in AnQi CMS and apply it to the front-end display?

Calendar 👁️ 60

As an experienced website operations expert, I am happy to give you a detailed explanation of the settings and front-end display application of the category banner image and thumbnail in Anqi CMS.In today's increasingly focus on visual experience, equipping the website's category page with eye-catching banners and concise thumbnails is undoubtedly a key step to improve user experience and optimize page layout.AnQi CMS is well-versed in this, providing intuitive and powerful features to easily achieve this goal.


AnQi CMS: Easily master the category Banner image and thumbnail, creating a visual feast

In AnQi CMS, whether it is article classification, product classification, or classification under other custom content models, we can set unique visual elements for them individually - category banner image and thumbnail.This not only makes your website more visually rich and professional, but also helps users quickly identify the content theme, greatly improving browsing efficiency and user experience.

1. Backend operation: Setting the category Banner image and thumbnail

First, let's understand how to configure these images for your categories in the Anqi CMS backend management interface.The entire process is designed to be very user-friendly, even for users who are new to it.

After you log in to the AnQi CMS backend, please find and click on "Content Management" in the left navigation bar, and then select "Document Category".Here, you will see all the categories created.You can edit an existing category or click 'Add New Category' to create a new one.

After entering the editing or creation page of the category, you will find that the form contains common information such as "Category Name", "Category Description", etc.Please scroll down the page to find the collapsible area labeled "Other Parameters" and expand it.This is the treasure land for setting up category visual elements.

1. Set Category Banner Image:In the "Other Parameters" area, you will see an option called "Banner Image".This field is used to upload images that will be displayed in large size at the top of the category page or in a specific area.AnQi CMS supports uploading multiple images very considerately, which means you can set a beautiful Banner carousel for a single category, adding dynamic feeling and interactivity to the page.When uploading images, it is a practical suggestion to try and keep the dimensions and proportions of all Banner images consistent, so that the effect can be neat and beautiful during the front-end carousel, and avoid the appearance of image distortion or layout jumping.You can select an image from the media library or upload a new one directly.

2. Set Category Thumbnail:Immediately below the "Banner image", there is the "thumbnail" setting.Different from the grandeur of the banner image, thumbnails are usually used in category list pages, recommendation modules, or sidebars, etc., where small-sized images are needed to summarize the theme of the category.It usually appears on the page in a small and exquisite form, helping users quickly find their target among many categories.Although not every category requires setting a thumbnail, if your frontend design needs to display category images in these scenarios, this is where you upload it.Prepare a high-quality thumbnail that represents the content of each category, which will help enhance the professionalism and visual consistency of the entire website.

After uploading and selecting the image, please make sure to click the "OK" or "Save" button at the bottom of the page to ensure that all your changes have been successfully saved to the system.

Second, front-end display: apply the image to the template

After the background settings are completed, the next step is how to make these carefully prepared images beautifully appear on your website's front-end template. Anqi CMS provides a powerful and flexible template tag system, especially the "category detail tag" (categoryDetailIt is the key to calling classification-related information.

1. Display the classification banner image (multiple images carousel):To display the Banner group image you have set for the category, you need to usecategoryDetaillabel'sImagesThe field returns an array of image URLs, which is very suitable for creating image sliders or multi-image displays.

Assuming you are editing the list page or detail page template for categories (for example{模型table}/list.htmlor{模型table}/detail.html),can be called directly in the following way:

{# 假设您正在分类页面,可以直接获取当前分类的Images #}
{% categoryDetail categoryImages with name="Images" %}
{% if categoryImages %} {# 检查是否有Banner图片上传 #}
<div class="category-banner-carousel">
    {% for image_url in categoryImages %}
    <img src="{{ image_url }}" alt="{% categoryDetail with name='Title' %} Banner" class="img-fluid">
    {% endfor %}
</div>
{% endif %}

This code will traversecategoryImageseach image URL in the array and generate the corresponding<img>Label. You can wrap a carousel component (such as Swiper, Owl Carousel, etc.) around it to easily achieve a Banner carousel effect.

If you only need to obtain the first Banner image as the main image of the category, for example, to display only one large image in a certain area of the category list page, you can handle it like this:

{% categoryDetail bannerImages with name="Images" %}
{% if bannerImages %}
{% set firstBanner = bannerImages[0] %} {# 获取数组中的第一张图片 #}
<img src="{{ firstBanner }}" alt="{% categoryDetail with name='Title' %} 主图" class="img-fluid">
{% endif %}

By{% set firstBanner = bannerImages[0] %}We cleverly extracted the first image from the image array and used it for display.

2. Display category thumbnails:As for the category thumbnail, it is usually a single image, which can be called more directly, just usingcategoryDetaillabel'sThumbthe field.

In your template, whether it is to display related categories in the category list, the home page recommendation module, or the article detail page, you can call the thumbnail like this:

{# 在需要展示缩略图的任何地方 #}
{% categoryDetail categoryThumb with name="Thumb" %}
{% if categoryThumb %} {# 检查是否有缩略图上传 #}
<img src="{{ categoryThumb }}" alt="{% categoryDetail with name='Title' %} 缩略图" class="category-thumb">
{% endif %}

Here, we usecategoryDetailThe tag fetched the thumbnail URL of the current category and embedded it into<img>the tag. To ensure the robustness of page rendering, we usually use{% if ... %}Check if the image exists to avoid invalid links when the image is not set.

It should be noted that,categoryDetailThe tag will default to fetching the current

Related articles

How to configure exclusive SEO title and keywords for a new page or category, to avoid TDK repetition?

As an experienced website operations expert, I know that every detail in the vast journey of Search Engine Optimization (SEO) may be the key to the success or failure of the website.Among them, TDK——that is, the title (Title), description (Description), and keywords (Keywords) of the page, is undoubtedly the first card presented by the website content to search engines.They not only directly affect the click-through rate of the page, but are also an important basis for search engines to understand the content of the page and to make ranking judgments.However, many operators after the expansion of the website scale

2025-11-06

How to manage and add Tag tags in bulk on the content editing interface to enhance content relevance?

As an experienced website operation expert, I fully understand the importance of content relevance to the success of a website.It not only helps search engines better understand our content structure, but also guides users to discover more interesting information, thereby improving user experience and staying time.In AnQiCMS (AnQiCMS), the Tag label feature is the core tool to achieve this goal.By managing and adding these tags flexibly and effectively, we can make each piece of content a bridge connecting to each other, significantly improving the overall relevance of the website's content.SafeCMS in `v2.1.0`

2025-11-06

Can the document introduction of Anqi CMS be automatically generated, and what is the word truncation rule?

As an experienced website operations expert, I am well aware of the core position of content in the website ecosystem, and the way content is presented, especially the generation and management of abstracts, is crucial for user experience and Search Engine Optimization (SEO).AnQiCMS (AnQiCMS) provides a smart and flexible mechanism in this aspect, allowing operators to manage and present content efficiently.Today, let's delve into how the document introduction of Anqi CMS is generated, as well as its word truncation rules.

2025-11-06

How to set up a timed publishing feature in the Anqi CMS editing interface to achieve automated content operation?

As an experienced website operations expert, I fully understand the importance of content timeliness and sustainability for website success.In a rich-featured content management system like AnQiCMS, making good use of its built-in automation tools can greatly enhance our operational efficiency.Today, let's delve deeply into a seemingly simple yet extremely powerful feature in Anqi CMS - scheduled publishing, and how to use it to achieve automated content operation.Say goodbye to manual operations: Anqi CMS's scheduled publishing makes content operation smarter In the fast-paced digital world

2025-11-06

How to obtain and display the data of newly added custom fields in the Anqi CMS content model when creating a template?

As an experienced website operation expert, I fully understand the importance of a flexible content management system for efficient operation.AnQiCMS (AnQiCMS) has laid a solid foundation for us to meet the diverse needs of content display with its powerful custom content model function.However, it is not enough to define these fields only in the background. How to accurately and elegantly present these carefully set custom data on the website front-end is the core challenge in template creation.

2025-11-06

The AnQi CMS document content editor, does it support direct insertion of content from the material library to improve editing efficiency?

## AnQi CMS Content Editor: Directly insert the material library, unleash the efficiency of content productionRepetitively uploading images, manually entering repetitive text, checking fixed format content, these trivial yet time-consuming tasks often slow down the rhythm of content publication.Therefore, when talking about whether the content editor supports direct insertion of content from the material library to improve efficiency, this undoubtedly touches on the pain points of operation work.

2025-11-06

Can the settings of the 'Category Template' be applied to all subcategories when editing, to achieve template inheritance?

## Unveiling the Secret Weapon of AnQi CMS Category Template Inheritance: Efficient Management of Subcategory Content In the daily operation of a website, the flexibility and efficiency of a Content Management System (CMS) are crucial, especially when a website has a large and complex category structure.AnQiCMS (AnQiCMS) is an enterprise-level content management system developed based on the Go language, and its capabilities in content publishing, management, and optimization are highly praised by users.

2025-11-06

How to add mathematical formulas and flowcharts in the Anqi CMS editing interface and ensure correct display?

As an experienced website operation expert, I am well aware that how to present technical information efficiently and beautifully in increasingly professional content creation is crucial.Continuous optimization of AnQiCMS (AnQiCMS) in content management, especially in supporting Markdown editors, has brought us great convenience.Today, let's delve into how to add mathematical formulas and flowcharts to your article content in the Anqi CMS editing interface, ensuring they are displayed correctly.

2025-11-06