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

Created on 24 February 2023, over 1 year ago
Updated 21 May 2024, about 1 month 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.69.0 2024