When multiple rocketship carousel sections are present, the first section's settings will be applied to all of them

Created on 24 February 2023, almost 2 years ago
Updated 21 May 2024, 7 months ago

Problem/Motivation

The carousel configuration is exposed through drupalSettings.
See https://git.drupalcode.org/project/rocketship_core/-/blob/6.x/src/Plugin...

When multiple such sections are present on the same page, this will be overwritten and only one configuration will be exposed.

That will be used for all the carousels on the page.
See https://git.drupalcode.org/project/rocketship_core/-/blob/6.x/js/layout-... and below.

This affects the slidesToShow and autoplay settings of Slick.

Steps to reproduce

Place two or more Rocketship Carousel sections on the same page with different configuration.
I.e. one with only 1 item visible in all breakpoint while the other(s) with 5,4,3,2 and 1 for each breakpoint.
Similarly, you can vary the autoplay option as well.

Proposed resolution

Add a unique identifier (i.e. class) to each carousel.
Add the configurations in an array to drupalSettings keyed by the same unique identifier.
Use the proper configuration for each carousel in the JS.

Remaining tasks

Create a fork / patch.

πŸ› Bug report
Status

Fixed

Version

6.1

Component

Code

Created by

πŸ‡·πŸ‡΄Romania reszli TΓ’rgu MureΘ™

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024