- Issue created by @adamps
- 🇮🇩Indonesia gausarts
Thank you.
The only reason it was removed for a single slider is to have a DOM diet.
However I understand a consistency might be needed somehow :)
Currently, if this must be in, we must also change the references in splidebox which assumed
splide-wrapper
ONLY exists as an identifier for navigation. If it is always present, it will break:
https://git.drupalcode.org/project/splidebox/-/blob/2.0.x/js/src/splideb...Perhaps we should replace it with
splide-wrapper--nav
to be more precise.Until then, you can copy the file into your theme if you don't use Splidebox, and adjust the HTML.
- 🇬🇧United Kingdom adamps
Thanks.
I found that using
splide-wrapper
class without a nav already breaks the base splide library. I didn't fully understand it, but I guess it might be fromsplide.load.js
line 143if (!$.hasClass(p, ID + '-wrapper')) {
. Maybe that code is specifically looking forsplide-wrapper
so won't likesplide-wrapper--nav
. Anyway I'm sure you will understand it much better than I do.Here's the template I ended up with. I skip the splide-wrapper class, but keep the others. I also added a class based on the optionset which is handy.
{# /** * @file * Default theme implementation for a splide wrapper. * * Available variables: * - items: A list of items containing main and thumbnail of splide.html.twig * which can be re-position using option Thumbnail position. * - attributes: HTML attributes to be applied to the list. * - settings: An array containing the given settings. * * @ingroup themeable */ #} {% set classes = [ settings.skin ? 'splide-wrapper--' ~ settings.skin|clean_class, settings.skin_nav ? 'splide-wrapper--' ~ settings.skin_nav|clean_class, settings.vertical ? 'is-wrapper-vertical', settings.vertical_nav ? 'is-wrapper-vertical--nav', 'splide-wrapper--' ~ settings.optionset|clean_class, blazies.is.nav ? 'is-wrapper-nav', settings.navpos ? 'is-wrapper-nav--' ~ settings.navpos|clean_class, 'over' in settings.navpos ? 'is-wrapper-nav--overlay', 'over' in settings.navpos ? 'is-wrapper-nav--' ~ settings.navpos|replace({ 'over-' : '' }) ] %} {%- if blazies.is.nav -%} {% set classes = classes|merge(['splide-wrapper']) %} {%- endif -%} <div{{ attributes.addClass(classes)|without('id') }}> {{- items -}} </div>