What are the required or commonly used parameters of the `bannerList` tag to configure the home page banner?

Calendar 👁️ 67

As an experienced website operations expert, I know the importance of the homepage banner for the first impression of website visitors and guiding user behavior. In AnQiCMS,bannerListThe label is the core tool we use to manage and present these key visual elements.It offers a simple and powerful design that allows content operators to easily achieve diverse homepage banner display needs.

Today, let's delve into it in depth.bannerListWhat are the required or commonly used parameters during the use of tags, and how to cleverly use them to configure a homepage Banner that is both beautiful and practical.


AnQiCMSbannerListLabel: Parsing the required and commonly used parameters for the home page banner configuration

In the era of digital marketing, the Banner area on the homepage of a website is like the facade of a brand, carrying multiple tasks such as displaying core products, promoting the latest activities, and guiding user paths. AnQiCMS is well-versed in this, providingbannerListThis powerful tag allows website operators to flexibly control the content and performance of the homepage Banner. Understanding its core parameters is the key to maximizing its effectiveness.

bannerListThe basic usage of the tag is very intuitive, it requires a variable name to carry the obtained Banner data, and it is used to{% bannerList 变量名称 %}...{% endbannerList %}The form enclosed in loops. For example, we usually name itbanners:

{% bannerList banners %}
    {# 在这里循环输出每个Banner的数据 #}
{% endbannerList %}

Once we get the Banner list, we can go throughforLoop throughbannersVariable, present the detailed information of each Banner one by one.

Core parameter one:type(Group name) - Flexibly define the display content.

When configuring the home page banner, the most commonly used and crucial parameter istype. Although it is not absolutely 'required', in actual operation, it is almost the key we use to distinguish and manage different Banner areas.

typeThe role of the parameterIt lies in, it allows you to fine-tune Banner groups in the AnQiCMS backend.For example, you may want to display a group of "main visual carousel" at the top of the homepage, a group of "brand event recommendations" in some side area of the page, or a group of "seasonal promotion banners" on a specific marketing page.Now, you can create multiple Banner groups in the background, and name them separately, such as 'Homepage Carousel', 'New Product Recommendation', or 'Brand Story'.

In the template, by specifyingtypeThe value of the parameter, you can accurately call the Banner list of the required group. For example, if you create a Banner group named 'Home Main Push' in the background, you can call 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>
            <p>{{ item.Description }}</p>
        </a>
    {% endfor %}
{% endbannerList %}

IftypeThe parameter is not specified,bannerListThe label will be obtained by defaulttype="default"Banners under the group. This provides convenience, but it also means that when managing Banners in the background, it is necessary to develop good classification habits to ensure that the corresponding Banners are categorized correctlytypeGrouping.

Core parameter two:siteId(Site ID) - Precise control in multi-site environments

For users operating single-site websites,siteIdparameters usually do not need to be paid attention to becausebannerListThe tag will default to fetching the banner data of the current site. However, if you are using the powerful multi-site management feature of AnQiCMS and need to call the banner data of another site in a template of a site, thensiteIdParameters become indispensable.

siteIdParameterAllow you to specify explicitly from which site to retrieve Banner data.This is particularly useful in scenarios of cross-site content sharing or multi-brand display.For example, if you have a primary site with ID 1 and a child site with ID 2, and you want to call a specific Banner of the child site from the primary site, you can set it up like this:

{% bannerList banners with siteId="2", type="子站推广" %}
    {# 循环输出子站的Banner #}
{% endbannerList %}

Please note,siteIdThe value should correspond to the site ID you set in the "Multi-site Management" section of the AnQiCMS backend.

Available Banner data fields

OncebannerListLabel successfully fetched the Banner data, you can then iterate throughbannerseach one in the variable (or the variable name you define)itemTo access the various information it contains. Each Banneritemusually provides the following key fields, which are the foundation for building Banner displays:

  • Id: Banner's unique identifier.
  • Logo: The file path or URL of the Banner image. It is the visual subject of the Banner, and it is crucial to ensure that the image size and quality meet the design requirements.
  • Link: The target URL after clicking the banner. This is the core to guide users to visit specific pages, products, or events.
  • Alt: Alternative text for banner image. This is not only SEO-friendly but also helps improve the accessibility of the website, displaying text when the image fails to load.
  • Description: Brief description information of the banner, which can be used for some auxiliary text descriptions.
  • Title: Banner's title. Although it is not explicitly listed in the parameter list in the document, it appears in the sample code, indicating that it is a commonly used, displayable text field, usually used for the main copy on the Banner.

By combining these fields flexibly, you can create a rich and diverse Banner display effect, ranging from simple image links to carousels with titles and descriptions, even dynamic Banners配合CSS animations.

Content operation tips

While usingbannerListWhen configuring the Banner tag, in addition to technical parameters, the following operational strategies can also help you a lot:

  1. Image size consistencyMake sure that all Banner images in the same group are of consistent size to avoid layout jumps and improve user experience.
  2. Clear call to action (CTA): The banner text and button should clearly indicate what the user will receive after clicking, stimulating the user's desire to click.
  3. Regular updatesKeep the Banner content timely and fresh,配合 the latest activities or products, to attract users' continuous attention.

Summary

bannerListThe tag is a powerful and flexible tool for configuring the home page banner in AnQiCMS. By巧妙运用其typeparameters for content grouping, and for precise utilization in a multi-site environment.siteIdYou can effectively manage and display a variety of Banner content.Combine the rich field information provided, you can easily create an eye-catching website front page that improves conversion rates.


Frequently Asked Questions (FAQ)

  1. Ask: How to manage and create Banner groups in AnQiCMS backend?Answer: In the AnQiCMS backend management interface, there is usually a menu item related to "Page Resources" or "Content Management", which includes a module such as "Banner Management" or similar.After entering, you can create a new Banner. When editing the Banner, there is usually an option for 'Group' or 'Type'. You can customize the group name here and assign the Banner to the corresponding group.After that, it can be passed through the front-end templatetypeParameters call these groups.

  2. Question: I have setbannerListThe label is there, but the homepage banner is not displayed, where could the problem be?Answer: First, check if the Banner has been created in the "Banner Management" backend and whether it is enabled. Second, confirm the "Group Name" of the Banner (i.e.,typeThe value of the parameter (with the one you use in the template)typeWhether the parameter matches completely, including case sensitivity. If not specifiedtypeThe parameter will call the "default" group's Banner by default. Finally, check the image pathLogoWhether the field is correct, as well as in the template codeforDoes the loop and field call have any spelling errors.

  3. Question:bannerListDoes the label support conditional display based on user role or access time?Answer:bannerListThe tag itself does not directly provide the function of conditional display based on user role or access time. It is mainly responsible for obtaining banner data under specified groups. However, you can use the AnQiCMS logical judgment tag in the template (such as{% if ... %}To implement this advanced requirement. For example, after obtaining the Banner list, you can determine whether to display a specific Banner based on the role of the currently logged-in user, or combinenowLabel fetches the current time, judges whether a Banner activity is within the valid period before displaying it.This is the need to combine Banner data with other system variables for judgment.

Related articles

How to display the Banner image list through the `bannerList` tag on the Anqi CMS homepage?

As an experienced website operations expert, I am well aware of the importance of the homepage banner for website visual appeal, user guidance, and brand promotion.In AnQiCMS such an efficient and flexible content management system, making good use of its built-in tags can help us easily achieve various content display needs.Today, let's delve into how to skillfully use the `bannerList` tag on the homepage of AnQiCMS to display your exquisite Banner image list.--- ### AnQiCMS and Banner

2025-11-06

What parameters does the `{% tagDataList %}` tag support to refine

Hello!As an experienced website operations expert, I am more than happy to provide a detailed explanation of the various parameters supported by the `{% tagDataList %}` tag in AnQiCMS, as well as how to skillfully utilize them to build more accurate and attractive content displays.In AnQiCMS, content tags (Tag) are an important way to organize and associate content, helping users quickly find topics of interest.

2025-11-06

How to display the list of all associated documents under the Tag tag detail page?

As an experienced website operations expert, I am well aware of the core role of tags (Tag) in content management and website optimization.A well-designed tagging system not only enhances user experience and helps visitors quickly find the content they are interested in, but is also an indispensable part of search engine optimization (SEO).AnQiCMS provides very flexible and powerful support for the Tag tag function, making it easy for us to achieve this goal.

2025-11-06

The `{% tagDetail %}` tag can get which field data of Tag?

As an experienced website operations expert, I deeply understand the strong potential of Anqi CMS in content management and SEO optimization.Today, we will delve into a very practical template tag in AnQiCMS——`{% tagDetail %}`, which can help us manage and display website tag data more finely, thereby improving user experience and search engine friendliness.

2025-11-06

How to use `for` loop to iterate over multiple home page Banner items obtained from `bannerList`?

In modern web design, the homepage banner is undoubtedly an important window to attract users' attention and convey core information.A dynamic and beautiful banner area can greatly enhance the visual appeal and user experience of a website.As an experienced website operation expert, I am well aware of the powerful and flexible content management of AnQiCMS (AnQi CMS).

2025-11-06

How to set the image link (`Link`) for each Banner in `bannerList`?

As an experienced website operations expert, I am well aware of the importance of every detail for website user experience and operation effectiveness.The banner (Banner) serves as the 'face' of the website, not only carrying the responsibility of beauty, but also as a key point for guiding users and conveying core information.In an efficient and flexible system like AnQiCMS, setting precise image links (`Link`) for each Banner is the basis for achieving this goal.

2025-11-06

How to correctly reference the image address of the home page Banner (`item.Logo`) in the template?

As an experienced website operations expert, I am well aware of the importance of the website homepage banner.It is not only the "face" of the website, carrying the brand image and core promotional information, but also the first visual point for users to enter the website.For users of AnQiCMS, how to efficiently and accurately refer to these banner images in templates, especially the image address `item.Logo` contained within them, is a common and basic requirement in daily operations. Today

2025-11-06

What is the role of the `item.Alt` field in the `bannerList` tag for SEO, and how to set it?

As an experienced website operation expert, I am more than happy to delve into the importance of the `bannerList` tag's `item.Alt` field in the AnQi CMS for website SEO and how to set it up effectively.In modern website operations, images are not only visual elements, but they also carry important information transmission functions, especially in search engine optimization (SEO).

2025-11-06