How to set up a Banner image and thumbnail for a category page and display it as a carousel or list on the frontend?

Calendar 👁️ 72

In website operation, adding attractive visual elements to category pages, such as banner images and thumbnails, is an important step to improve user experience and website professionalism.AnQiCMS (AnQiCMS) is an efficient and flexible content management system that fully considers these needs, allowing you to easily set and display these images for category pages.

This article will guide you on how to configure Banner images and thumbnails for category pages in Anqi CMS backend, and share practical methods for displaying them as a carousel or list in the website frontend template.


The first step: Set the Banner image and thumbnail for the category page in the background

The strength of AnQi CMS lies in its flexible content model and category management functions. To set a Banner image and thumbnail for the category page, you just need to enter the "Content Management" module of the backend:

  1. Enter Category Management:Log in to the AnQi CMS backend, navigate to the "Content Management" menu, and click on "Document Category."

  2. Select or create a category:In the category list, you can select an existing category to edit or click the 'Add Category' button to create a new category.

  3. Edit category information:On the category editing page, in addition to filling in the basic information such as category name, category introduction, etc., you will see a 'Other Parameters' collapse area.Expand this area, and you will find the settings options for 'Banner Image' and 'Thumbnail'.

    • Banner image:This is a particularly useful feature, you can upload multiple images as the Banner of the category page.This means you can set a Banner carousel for the same category page, adding a sense of dynamics and visual impact to the page.When uploading images, it is recommended to upload images of the same size to ensure the coordination and uniformity of the front-end carousel effect.
    • Thumbnail:Thumbnail is usually used in category lists, navigation menus, or other locations requiring small-sized images, as the representative icon or preview image of the category.You can upload an image as a thumbnail for the category. Unlike the Banner image, a thumbnail usually only needs one image.
  4. Save settings:After completing the image upload and selection, don't forget to click the 'OK' button at the bottom of the page to save your category settings.

By following these simple steps, you have already configured the required visual elements on the category page in the AnQi CMS backend.Let's see how we can display these images on the website front-end.


Step two: Display the Banner image and thumbnail in the front-end template.

The AnQi CMS adopts a template engine syntax similar to Django, allowing you to easily call the category information set in the background, including Banner images and thumbnails.

1. Display Banner image and thumbnail on the category detail page

When a user visits a specific category page, you may want to display a large Banner image at the top of the page or show a category thumbnail on the side. At this time, we can usecategoryDetailLabel to get the details of the current category.

Assuming you are editing the list template of categories (for example){分类模型}/list.html):

{# 首先,我们获取当前分类的详情信息 #}
{% categoryDetail currentCategory %}

{# 展示分类Banner图 (支持多张图片轮播) #}
{% if currentCategory.Images %}
<div class="category-banner-area">
    {# 这里是一个简单的图片列表,实际轮播效果通常需要前端JS库辅助实现 #}
    {% for image in currentCategory.Images %}
        <img src="{{ image }}" alt="{{ currentCategory.Title }} 分类Banner" />
    {% endfor %}
</div>
{% endif %}

{# 展示分类缩略图 (通常用于单个展示) #}
{% if currentCategory.Thumb %}
<div class="category-thumbnail">
    <img src="{{ currentCategory.Thumb }}" alt="{{ currentCategory.Title }} 分类缩略图" />
</div>
{% endif %}

{# 您也可以获取分类大图,通常与缩略图是同一张但可能尺寸更大 #}
{% if currentCategory.Logo %}
<div class="category-logo">
    <img src="{{ currentCategory.Logo }}" alt="{{ currentCategory.Title }} 分类Logo" />
</div>
{% endif %}

{# 继续展示分类名称、描述等其他信息 #}
<h1>{{ currentCategory.Title }}</h1>
<div>{{ currentCategory.Description }}</div>

{# 假设这里是该分类下的文档列表 #}
<div class="archive-list">
    {% archiveList archives with type="page" categoryId=currentCategory.Id limit="10" %}
        {% for item in archives %}
            <div>
                <h3><a href="{{ item.Link }}">{{ item.Title }}</a></h3>
                {% if item.Thumb %}
                    <img src="{{ item.Thumb }}" alt="{{ item.Title }}" />
                {% endif %}
                <p>{{ item.Description }}</p>
            </div>
        {% endfor %}
    {% endarchiveList %}
    {% pagination pages with show="5" %}
        {# 分页代码略 #}
    {% endpagination %}
</div>

2. Display thumbnails in the category list

If you want to display a category list on the homepage, navigation menu, or other aggregate pages of your website, and have each category with its thumbnail, we can usecategoryListInformation about looping to get multiple categories.

{# 获取所有顶级分类,或指定父分类下的子分类 #}
{% categoryList categories with moduleId="1" parentId="0" %}
<div class="category-list-section">
    {% for category in categories %}
    <div class="category-item">
        <a href="{{ category.Link }}">
            {% if category.Thumb %}
                {# 使用缩略图作为分类的代表图片 #}
                <img src="{{ category.Thumb }}" alt="{{ category.Title }}" class="category-list-thumb" />
            {% endif %}
            <h3>{{ category.Title }}</h3>
            <p>{{ category.Description }}</p>
        </a>
    </div>
    {% endfor %}
</div>
{% endcategoryList %}

Description of Banner carousel effect.

The AnQi CMS provides you with the function to upload multiple banner images in the background, and uses them in the template.currentCategory.ImagesThe array is provided to you. To achieve a real Banner carousel effect, it usually requires the use of front-end JavaScript libraries (such as Swiper.js, Owl Carousel, etc.) and the corresponding CSS styles.The Anqi CMS is responsible for providing data, while the front-end code

Related articles

How to customize SEO title, keywords, description, and URL display on the category page to optimize the performance of the category page?

In website operation, category pages play a vital role, they are not only the key entry points for users to browse content and explore the website structure, but also the core nodes for search engines to understand the website theme and allocate weight.Effectively optimize the SEO performance of the category page, which can significantly improve the overall visibility and user experience of the website.AnQiCMS (AnQiCMS) provides powerful and flexible tools for users, allowing for detailed customization and optimization of SEO titles, keywords, descriptions, and URL structures on category pages.

2025-11-08

How does AnQiCMS ensure the correct rendering and display of article content (including Markdown, mathematical formulas, flowcharts) on the front-end?

In today's era of increasingly rich and diverse content creation, we often need to present on websites not only plain text, but also a variety of Markdown documents, complex mathematical formulas, and intuitive flowcharts.As website operators, the most concerning issues for us are whether the input of these contents is convenient, and whether they can be correctly and beautifully rendered and displayed on the front end.AnQiCMS (AnQiCMS) provides a highly efficient and flexible solution in this regard.###

2025-11-08

How to set a thumbnail for an article and control its display size and method on different list pages or detail pages?

In website content operation, article thumbnails play a vital role.It is not only the 'face' of the article content, attracting visitors to click, but also effectively improves the overall beauty and user experience of the page.AnQiCMS provides a comprehensive and flexible set of features, helping us easily set thumbnails for articles and finely control their display size and method according to different scenarios. ### One, set the thumbnail for the article Adding a thumbnail to the article is an important part of the content publishing process.

2025-11-08

How does AnQiCMS handle the SEO title, standard link, and permanent link of articles, affecting their display in search engines?

In website operation, Search Engine Optimization (SEO) has always been a key link in obtaining natural traffic.How a content management system (CMS) effectively handles the SEO title, link structure, and URL normalization directly determines the visibility and performance of your content in search engines.AnQiCMS (AnQiCMS) is a system focused on enterprise-level content management, providing flexible and powerful tools in these aspects to help us better optimize website content.### Accurately Control Search Results

2025-11-08

How AnQiCMS content model custom fields can be flexibly called and displayed in the front-end template?

In AnQiCMS, the custom field of the content model has brought great flexibility to our website content management, allowing us to add unique attributes to content types such as articles, products, and events according to different business needs.But it is not enough to create these fields in the background. How to flexibly present them on the website front-end, so that visitors can see this customized information, is the key to content operation.Next, we will delve into how the AnQiCMS content model custom fields can be flexibly called and displayed in the front-end template, helping you make full use of this powerful feature.###

2025-11-08

How to display an article list on the front end and support filtering by content model, category, recommendation attributes, and other conditions?

AnQi CMS provides extremely high flexibility for website content, whether it is displaying articles, products, or other custom content, it can easily cope with it.When we need to display a content list on the website frontend and allow users to filter based on content models, categories, recommended attributes, and other conditions, Anqicms provides very intuitive and powerful template tags to achieve these functions. Flexible customization of list display, which not only improves user experience but also effectively helps visitors quickly find the information they are interested in.In AnQi CMS

2025-11-08

How to implement pagination display of article lists in AnQiCMS and customize the style and logic of pagination navigation?

AnQiCMS as an efficient and flexible content management system provides intuitive and powerful functions for handling article lists and pagination display, allowing content presentation to meet user needs and various customized scenarios.If you are using AnQiCMS to build a website and want to implement pagination for the article list, and finely control the style and logic of the pagination navigation, then the following content will explain the implementation method in detail.

2025-11-08

How does image resource management in AnQiCMS affect the display quality and loading speed of front-end images?

In the process of running a website, images play a crucial role.They are not only part of the content presentation, but also a key factor affecting user experience and website performance.AnQiCMS (AnQiCMS) provides a series of practical functions in image resource management, which are directly related to the display quality and loading speed of the pictures on our website's front end.Deeply understand and make good use of these tools, which can help us build a website that is both beautiful and efficient.Why is image management crucial for a website?

2025-11-08