PS PrestaShop Beginner

Homepage Slider and Banners: documentation

Install and configure DF Home Banners 2.0: visual builder, text and button over the image, cropping, scheduling in the shop's time, targeting, statistics, ps_imageslider import and upgrade from 1.x.

Updated Module version 2.0.0

Overview

DF Home Banners builds the top of your PrestaShop shop’s homepage: a main slider, two side banners, two wide banners and a banner grid. Each banner combines an image (or a muted background video) with a heading, a text and a button that the module places over the image, in every language. The module runs on PrestaShop 1.7.8, 8 and 9, in multistore, with the Classic and Hummingbird themes.

Home page on desktop: slider with heading and button, two side banners and two banners below

Under 768 px, each banner can use a dedicated mobile image, for example in portrait format, to keep the text readable. The carousel always displays a button to stop the rotation.

Home page on mobile: dedicated portrait image, readable text and a stop button for the rotation

Installation

  1. In the back office, open Modules > Module Manager and click Upload a module.
  2. Drop the dfhomebanners-2.0.0.zip file and wait for the installation to finish.
  3. Open the module from Design > Home banners (or with the Configure button in the Module Manager).

The module hooks into displayHome and displayHeader. Its CSS and JavaScript files are loaded only on the homepage, and only when at least one banner is visible.

Requirements: PHP 7.1 or later (tested on 7.4, 8.1 and 8.5) with the GD extension and WebP support. AVIF requires PHP 8.1 and GD built with libavif; otherwise, the module serves WebP. Zip export and import require the ZipArchive extension.

The visual builder

The Builder tab arranges banners by location: Main slider, Side banner (top and bottom), Bottom banner (left and right) and Banner grid. For each banner, you see its status (Online, Disabled, Scheduled, Expired), the devices where it is displayed and the points to fix, such as a missing alt text.

Visual builder: banners per location, drag and drop, status and real preview per device
  • Order: drag a banner, or use the Move up and Move down buttons with the keyboard.
  • Activation: a switch enables or disables the banner immediately.
  • Actions: Edit, View, Duplicate, Delete. On deletion, images are removed only if no other banner uses them.
  • Preview: the right-hand panel shows the real rendering of the homepage block. Choose the device (Mobile, Tablet, Desktop), the language and a date to see the homepage as it will be at that moment. Check “Include disabled and scheduled banners” to see them too.

In a fixed location (side banner or bottom banner), only the first visible banner of the list is displayed: you can therefore prepare several banners and let the schedule choose.

The builder warns you if the block is not at the top of the homepage (its first image is then not preloaded, with a “Move to the top of the home page” button), if the native ps_imageslider module displays a second slider, or if images from version 1.x still need to be converted.

Creating or editing a banner

Click Add in a location or Edit on an existing banner. The editor shows the settings on the left and, on the right, a preview updated as you type (links are disabled in the preview). Choose the editing language at the top of the page, then click Save or Save and go back.

Banner editor: location, image with weight and width advice, live desktop preview

Image, mobile image and video

  • Image: JPEG, PNG or WebP. SVG and other formats are refused. The image is re-encoded on upload (metadata and GPS data removed), then served in several widths in WebP, and in AVIF when the server supports it. The editor shows the recommended width for the location and the resulting weight.
  • Mobile image (optional): shown under 768 px instead of the main image.
  • Same image for all languages: when checked, a single image is used for all languages; when unchecked, you upload one image per language. A language without an image does not display the banner.
  • Background video: MP4 or WebM, always muted, played in a loop only when the visitor has not asked to reduce motion. The image is used as the poster.

Default limits: 12 MB per image, 25 MB per video (adjustable in Settings, within the server limit), 12,000 px per side and 50 megapixels maximum.

Cropping and focal point

The Crop button opens the cropping window: choose a ratio (21:9, 16:9, 3:1, 12:5, 4:3, 1:1, 4:5, 9:16 or Free), then drag the frame or its corners. With the keyboard, the arrow keys move the area and the + and – keys resize it. The original is kept: you can crop again later.

Cropping the image to 21:9, the original being kept to crop again later

The Focal point marks the subject of the image. When the slider frame crops the image (on mobile, for example), the module keeps this point visible.

Heading, text and button

In Text and button, enter a heading, a short sentence and the button label for each language. These are real HTML texts placed by the module: they remain editable and translatable without redoing the visual.

Editor: heading, text and button per language, position, overlay and estimated contrast, mobile preview
  • Text position: 9 positions, from Top left to Bottom right.
  • Text color: Light or Dark.
  • Button style: Filled, White, Dark or Outline.
  • Overlay behind the text: Gradient or Solid, with an adjustable intensity. The editor shows an estimate of the contrast between the text and the image to help you keep the text readable; always check the result in the preview.

Avoid writing the message into the image itself: embedded text cannot be translated, cannot be read by search engines and becomes tiny on mobile. Keep the image for the mood and let the module place the text.

Choose the link target: a Product, a Category, a Brand or a CMS page (type a name, a reference or an ID), or a Custom URL. The link is generated in the visitor’s language and follows the URL rewriting. Accepted URLs start with https://, http://, /, mailto: or tel:; any other address is refused. Leave empty for a banner without a link. Options: Open in a new tab, nofollow and sponsored.

Accessibility

Enter an Alternative text that describes the image: it is read by screen readers and shown when the image cannot load. Languages left empty take the text of the default language. If the banner text says everything, check Decorative image (empty alt). A linked banner with a decorative image must have a heading or a button label.

Scheduling and targeting

Enter a Start date and an End date, or use the shortcuts “For 7 days”, “For 30 days”, “Next weekend” and “No dates”. Dates follow the time zone configured in PrestaShop; the editor shows the current shop time. A scheduled banner appears and disappears on time, without clearing any cache.

Editor: scheduling in the shop time zone and targeting by device, language and customer group
  • Devices: Mobile, Tablet, Desktop. On a device where the banner is hidden, its image is not downloaded.
  • Languages: the banner is displayed only in the checked languages.
  • Customer groups: none checked, everybody sees it; otherwise, only the checked groups (a visitor who is not logged in belongs to the “Visitor” group).
  • Shops: in multistore, choose the shops where the banner is displayed.

Planning

The Planning tab shows the next weeks: each bar shows when a banner is displayed, and the red line marks the present moment. The “Upcoming changes” list shows the upcoming starts and ends; the Preview at this date button opens the homepage preview at that moment.

Planning of the next weeks and upcoming changes, with a preview at a given date

Statistics

The Statistics tab shows clicks on banners over a given period: total, most clicked banner, clicks per day and share of each banner. The module records one counter per banner and per day, with no cookie, no IP address and no customer identifier. Bots that run JavaScript can be counted. Counting can be disabled in Settings.

Click statistics per banner and per day, without cookie or personal data

Settings

Settings: layouts, slider frame, accessible rotation, WebP and AVIF quality

Layout

  • Layout: slider with side column on the right (two banners below), side column on the left, or full-width slider with the four banners in one row.
  • Slider frame: a fixed ratio for desktop and tablet, another for mobile, or the image size. A fixed frame gives all slides the same height; images are cropped around their focal point.
  • Grid: number of columns on desktop and on mobile.
  • Maximum width (0 = width of the theme container), Corner radius, Spacing.
  • Heading markup: Paragraph (does not change the page outline), Heading level 2 or Heading level 3.

Slider

Automatic rotation, delay between slides (6 seconds by default), transition (Horizontal slide or Fade), previous / next arrows and dots. The rotation always has a visible stop button, pauses on hover, stops when keyboard focus enters the slider and does not start when the visitor asks to reduce motion. The behavior follows the “Carousel” pattern of the WAI-ARIA Authoring Practices Guide.

Images

Compression quality (80 by default), AVIF generation (the module shows whether your server supports it), maximum image size and maximum video size. Changing the quality or formats offers to regenerate the existing images.

Performance and statistics

Preload the first slide: “Automatic” preloads the first image only when this block is the first one of the homepage, which is the recommended setting; “Always” and “Never” force the choice. Preloading an image that is not at the top of the page slows down the rest of the page. The Count clicks option enables the statistics.

When the module is uninstalled

Choose Keep banners and images (reinstalling the module restores everything) or Delete everything (tables, settings and the img/dfhomebanners/ folder are deleted). By default, everything is kept.

Tools

Tools: import of ps_imageslider slides, zip export and import, image maintenance

Importing from ps_imageslider

If the native “Image slider” module (ps_imageslider) is installed, the Tools tab lists its slides. Check the ones to import: images, titles, texts and links become slider banners, disabled unless you check “Enable the imported slides at once”. Then disable ps_imageslider to avoid two sliders on the homepage. Nothing is deleted from ps_imageslider, and you can enable it again from the same screen.

Export and import

Export produces a zip with the banners of the current shop context, their texts, settings, source images and videos. Import a zip adds the banners disabled; every image goes through the same checks as an upload. Handy for copying a campaign from a staging shop to the live shop.

Maintenance

Regenerate all images rebuilds every width and format from the kept source images. Delete the 1.x copies removes the files of modules/dfhomebanners/uploads/ already copied to img/dfhomebanners/.

Upgrading from version 1.x

Install the 2.0.0 zip over the current version from Modules > Module Manager > Upload a module, then run the upgrade if PrestaShop offers it. The upgrade script:

  • keeps all banners, their images, links, dates, positions and settings;
  • copies the images to img/dfhomebanners/, a folder that survives the module being replaced, and generates the responsive variants;
  • redirects the old image addresses (modules/dfhomebanners/uploads/) to the new ones under Apache.

If the builder shows “Finish the image migration”, click the button to convert the remaining images. Check your dates: 2.0.0 compares dates with the shop time, whereas 1.x used the database time. Once you have checked the result, you can delete the 1.x copies from the Tools tab.

Back up the database and files before any module upgrade on a production shop.

Troubleshooting

Nothing is displayed on the homepage

  • Check that the module is enabled and that the banner is “Online” in the builder (not disabled, scheduled or expired).
  • Check the targeting: language, customer group, device and shop. Use the builder preview with the right device and the right language.
  • Check that the banner has an image in the displayed language.
  • Check that your theme calls the displayHome hook on the homepage.

Two sliders on the homepage

The native ps_imageslider module is still active. Import its slides, then disable it from the Tools tab.

The first image is not preloaded

Other modules are displayed above the block on the homepage. Click “Move to the top of the home page” in the builder, or choose “Always” in Settings if you know the block is at the top of the page.

Errors when uploading an image

  • File larger than the server upload limit: increase upload_max_filesize and post_max_size with your host, or reduce the image.
  • Not enough server memory for this image: reduce the image dimensions (a width of 2,400 to 3,000 px is enough for a slider).
  • The folder img/dfhomebanners/ is not writable: fix the permissions of this folder.
  • Security token expired: reload the back office page.

Changes do not appear

The module clears its own cache on every change. If an external page cache (CDN, cache module, Varnish) is active, purge it. On PrestaShop 1.7 with CCC enabled, clear the cache from Advanced Parameters > Performance.

Uninstallation

Before uninstalling, choose in Settings > When the module is uninstalled whether you want to keep the banners and images or delete everything. Then uninstall from Modules > Module Manager. With “Keep”, a reinstallation restores the banners as they were. The ps_imageslider module is never modified by the uninstallation.

Was this page helpful?

Still stuck? Contact support