You can add as many banner sections as you want in the template. Individual banners can then be easily added, edited, and removed from the back office for each section.
Adding a banner section, even if it may seem simple, still requires some knowledge of HTML and CSS. You may also need to modify HTML and CSS to correctly display the banners on the store and in the desired style.
Before you can add a new banner section to a template page, you must define it in the editor.json file.
"locations" field add the following:
{
"location" : "Offers",
"label" : {
"en" : "Winter offers",
"it" : "Offerte invernali"
}
}
Offers you should provide the name used to reference the banner in template code. The name must start with a capital letter and must not contain spaces (more precisely, it must follow the syntax of a Go identifier).import instruction at the beginning of the file, as the first line or second line if the first line is an extends instruction:
{% import "/imports/banners.html" %}
provided that the "/imports/banners.html" import is not already present.
{% show Banner(banners.Offers, "") %}
where instead of Offers you should write the name of the banner section to display. To show the banners as a slideshow with timing "6000/500":
{% show Banner(banners.Offers, "6000/500") %}