How to manage and display custom page Banner carousel in Anqi CMS?

Calendar 👁️ 92

In website operation, a beautiful page banner carousel is a key element to attract visitors' attention, convey important information, and enhance brand image.AnQiCMS provides a flexible and intuitive way to manage and display these visual contents, whether you want to set up a Banner for the homepage, a specific page, or a category page, it can be easily achieved.

Manage custom Banner carousel

The AnQi CMS allows you to set exclusive Banner images for different content types, mainly including Banners for specific pages, Banners for category pages, and Home or Global Banners implemented through tags.

For a specific page Banner:If you need to configure a Banner Carousel for single-page pages such as "About Us" and "Contact Us", you can go to the AnQi CMS backend management interface.First, click on the left menu's 'Page Resources', then select 'Page Management'.Here, you can edit an existing single page or create a new one.In the page editing interface, scroll down to find an option named "Banner image".You can upload multiple images here, which will constitute the banner carousel of this page.To maintain a neat and professional page layout, it is recommended that you upload images of consistent size.

For a category page Banner:For pages that need to display carousels for article categories, product categories, etc., the operation process is similar to that of a single page.You need to go to the "Content Management" backend, then click "Document Category"。Select the category you want to set for the Banner and edit it.In the category editing interface, you will also see an option for a "Banner image", where you can upload the Banner image for the category page.Similarly, please ensure that the uploaded images have a uniform size to maintain the consistency of the front-end display effect.

For the homepage or global Banner:AnQi CMS also providesbannerListThe label can be used to obtain the Banner image for the homepage or other general areas.Although the document does not directly display the detailed management entry on the background, the existence of this tag indicates that the system supports this kind of global Banner configuration.Generally, these Banners will have a 'group name' (type), such as 'slide', to distinguish different Banner groups for front-end calls.

Display Banner carousel in the front-end template

After completing the image upload and configuration on the back-end, the next step is to display these banners on the website front-end.This requires you to use specific tags in the Anqi CMS template files to call data.Anqi CMS uses a Django-like template syntax, through double curly braces{{变量}}and percent sign curly braces{% 标签 %}to operate data.

Get single page Banner data:In the template file of a single page (for examplepage/detail.htmlor a custom single page template), you can usepageDetailLabel to get the details of the page, including Banner images. The label provides a name calledImagesThe field will return an array containing all the Banner image URLs.

{# 假设在单页面模板中获取Banner图片 #}
{% pageDetail pageImages with name="Images" %}
<div class="banner-carousel">
    {% for imageUrl in pageImages %}
    <div class="carousel-item">
        <img src="{{ imageUrl }}" alt="页面Banner" />
    </div>
    {% endfor %}
</div>

If your design only needs to display a background image and not a carousel, you can also directly obtain the first image from the array:

{% pageDetail pageImages with name="Images" %}
{% if pageImages %}
{% set firstBanner = pageImages[0] %}
<div class="page-header" style="background-image: url('{{ firstBanner }}');">
    {# 这里可以放置页面标题等内容 #}
</div>
{% endif %}

Get the Banner data for the category page:Similar to a single page, in the template file of the category page (such as{模型table}/list.htmlor a custom category template), you can usecategoryDetailtags to get the category Banner image. Similarly, through

Related articles

How does AnQi CMS filter and display content based on the document's Flag attribute (such as headline, recommended)?

In AnQiCMS (AnQiCMS) content management system, effectively organizing and displaying content is the key to enhancing website attractiveness and user experience.Among them, the Flag attribute (recommended attribute) function of the document, as if marking the content with a special 'mark', allows you to flexibly filter and highlight important or specific types of content according to your operational needs.What is the document Flag attribute? The document Flag attribute, also known as the recommendation attribute, is a content classification and display mechanism provided by AnQi CMS.

2025-11-08

How to add multi-dimensional parameter filtering function for the product list page in Anqi CMS and display the filtering results?

In modern e-commerce and content display websites, providing multi-dimensional parameter filtering functions for product lists has become a key factor in improving user experience and conversion rates.Visitors can quickly locate the products they need based on their own needs, not only saving time but also significantly improving the usability of the website.For users of AnQiCMS, implementing such a feature is not difficult. The built-in powerful functions and flexible template tags make the whole process intuitive and efficient.This article will delve into how to add multi-dimensional parameter filtering functions to the product list page in Anqi CMS

2025-11-08

How to display the current year or time in a specific format in AnQi CMS template?

In website operation, it is a common requirement to flexibly display the current year or format specific time, whether it is the automatic update of the year in the copyright statement or the clear display of the publication time on the article detail page.AnQiCMS provides two main ways to meet these needs, they are both simple to use and follow the elegant time handling of the Go language.### Method 1: Directly retrieve and display the current year or time (`{% now %}` tag) When you need to directly retrieve and display the current year or the current time down to the second in the template

2025-11-08

Does AnQi CMS provide an integrated JS statistics code calling tag for easy display on the page?

When using AnQiCMS, many users are concerned about how to conveniently integrate third-party JavaScript statistical codes into web pages, such as Baidu Statistics, Google Analytics, and so on.About this, AnQiCMS indeed provides built-in mechanisms and flexible template tags, allowing you to easily call and display these statistics codes on your website.### Using built-in JS code to call tags AnQiCMS to meet the needs of website operators to integrate third-party scripts

2025-11-08

How to implement the like function for comments in Anqi CMS and update the display of likes in real time?

In website operation, user interaction is a key link in enhancing community activity.The like comment feature not only encourages user participation, but also helps website administrators identify popular comment content.For websites using AnQiCMS, to implement this feature and update the like count in real time, it can be done through the built-in template tags and a bit of front-end JavaScript code.### Comment Function Basics: How to Display Comment Lists The core of the comment function in AnQi CMS lies in the `commentList` template tag

2025-11-08

How to safely output rich text content containing HTML tags in Anqi CMS template?

In website operation, rich text content is widely used in articles, product introductions, and single-page scenarios due to its rich expression, such as inserting images, custom font styles, and tables.AnQi CMS as an efficient content management system also fully supports the editing and storage of various rich text content.However, rich text content, while bringing convenience, also hides a non-negligible security challenge - how to safely output this content containing HTML tags in templates to prevent potential cross-site scripting attacks (XSS)

2025-11-08

How to implement independent content management and unified display for multi-sites in AnQiCMS?

How to implement independent content management and unified display for multiple sites in AnQiCMS?In today's rapidly changing internet environment, many enterprises and content operators face the challenge of managing multiple websites.Whether it is to have multiple brands, product lines, or to create independent content portals for different markets and audiences, efficiency and convenience are always the key.The traditional approach is often to deploy a separate system for each website, which not only increases maintenance costs but also makes content management and data integration extremely complex.AnQiCMS provides an elegant and efficient solution

2025-11-08

How to customize the content model so that it can display different types of content in a unique way on the front-end page (such as articles, products)?

In Anqi CMS, the custom ability of the content model is one of its core advantages, which gives us great flexibility, allowing the website to break free from the traditional constraints of 'articles' and 'pages', and organize and display various types of information according to actual business needs.Whether it is a complex e-commerce product detail or a refined corporate case presentation, it can present unique style and functions on the frontend page through a custom content model.### Understanding the importance of content models A content model, simply put, is the "skeleton" or "blueprint" of the content on your website

2025-11-08