As an expert well-versed in website operation, I fully understand the importance of the homepage banner for the image and marketing promotion of the website.It is not only a visual focus, but also a key area for conveying core information and guiding user behavior.bannerListlabel combined withtypeParameters, let us accurately call the home page Banner under a specific group according to different operation requirements. Today, let's delve into this practical feature.
use cleverlytypeParameters: Unlock the secrets of the security CMS home page banner group call
In today's fiercely competitive online environment, the home page banner of a website is like a showcase, the first front line to attract visitors' attention and convey core information.A well-designed and precise Banner that can effectively improve user experience and promote conversion.An efficient content management system, AnQi CMS, understands the importance of this requirement and has therefore designed the Banner management feature in detail.How can we flexibly display specific groups' Banners on the homepage accurately according to different scenarios, such as marketing activities, seasonal themes, etc?bannerListTags andtypeare where the parameters really shine.
Learn about the Banner management mechanism of the security CMS
The Auto CMS was designed with the diversity of website content and operational flexibility in mind from the beginning.It allows you to create and manage multiple Banner groups in the background.This means you can prepare exclusive Banner sets for different marketing campaigns, product series, or page areas (such as the homepage image carousel, sidebar mini Banner, a specific holiday promotion Banner, etc.).This grouping capability aims to help operators achieve more refined content placement, avoiding all Banners mixed together and making it difficult to manage and schedule.
core tools:bannerListTags andtypeParameters
bannerListIs a powerful template tag provided by AnQin CMS, specifically used for calling the background configuration of the Banner image list on the front-end page. Its core lies in a name calledtypeThe parameter. This parameter is the 'Group Name' you set for Banner groups in the background, when you specify it in the template.type="您的分组名"whenbannerListThe label will intelligently filter and only return all Banner image data under the current group.
For example, if you have created a Banner group named "Home Page Large Image" and uploaded some exquisite images in the background, you can write it like this in the template:
{% bannerList banners with type="首页大图" %}
{% for item in banners %}
<a href="{{item.Link}}" target="_blank">
<img src="{{item.Logo}}" alt="{{item.Alt}}" />
<h5>{{item.Title}}</h5>
</a>
{% endfor %}
{% endbannerList %}
If omittedtypeParameter, the system will call the one nameddefaultunder the group. This makes the calling of Banner both highly customizable and maintains a certain default nature, very flexible.
In the above code,bannersIt is a variable name we define, used to store the list of Banner data obtained from the background. Byforlooping, we can iterate over each element in this list.item(i.e., each Banner object). Eachitemcontains a series of available fields, such as:
item.Id: Banner的唯一标识ID。Englishitem.Logo: The address of the Banner image, which is the most commonly used field.item.Link: Banner点击后跳转的链接地址。item.Alt: Banner image alternative text, very important for SEO and accessibility.item.Title: Banner title, usually used for combined image and text display or SEO assistance.item.Description: Banner description, used for displaying more detailed information.
Step-by-step practice: How to call a specific group Banner in the template
Understood the principle, next let's see the specific operation steps:
Step 1: Set the Banner group in the Anqi CMS backend
Step 2: Identify the target group name
After setting up the group in the background, the key is to remember the exact name you have set for the group. For example, if you set a group name to "Home Carousel", then in the template,typeThe value of the parameter should be `