splide-minimal.html.twig used for non-vanilla display

Created on 18 December 2023, 11 months ago
Updated 14 April 2024, 7 months ago

Problem/Motivation

I configured a slider with nav, without using vanilla, and it's using the splide-minimal.html.twig template, which has a comment that implies that it's used when vanilla is selected:

* @file
* Default theme implementation for the splide-minimal item template.
*
* This is a vanilla alternative for splide__slide.html.twig where everything is
* dumped as is into 'item'. Think of it as a raw individual item output.
* Choosing vanilla means you are on your own, and want a more controlled item.
* Be warned! This template is also used by thumbnail navigation which happens
* to have the same structure and attributes. Be sure to not mess up thumbnails
* should you need to work with vanilla versions.

Steps to reproduce

Create a slider with nav, using Splide Media formatter.

Proposed resolution

If it's supposed to use this template, update the comment to say that it's used for both vanilla and navigation. Otherwise it sounds like it's incorrectly being used when vanilla is not selected.

Remaining tasks

Verify analysis of the situation.

User interface changes

None to UI, but improve @file comment and Readme.

API changes

None.

Data model changes

None.

💬 Support request
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States mortona2k Seattle

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

Comments & Activities

  • Issue created by @mortona2k
  • 🇺🇸United States mortona2k Seattle

    I have been thinking that SDC integration in a future version would make things easier to theme.

    Currently we have to use template suggestions and library overrides.

    The skins implementation requires a custom module and can't be done by theming alone.

  • 🇺🇸United States mortona2k Seattle

    One of the things I learned is that it's helpful to have your custom slide styles in a module instead of a theme, so they work inside the views UI. Otherwise it is currently not possible to create a view of entity references using rendered entity with your theme's css and templates unless you're using your theme for admin.

    This ticket was created out of confusion, I wasn't sure why things were working the way they did or how to approach creating the sliders I needed. I think I was expecting to get the media template instead of splide__slide with the vanilla option, I'm not sure anymore.

    I was able to configure what I needed for 2 sliders, but had to build one from scratch using a custom views formatter with a SDC to load splide. I did end up using blazy for loading remote videos, and I like how that configuration is exposed in the splide formatters.

    I'm thinking that this paradigm of using SDC improves the DX vs learning the specific things handled by all the classes and options in the module. It might make sense to add a starting component that we could copy and modify. There could be several components as examples for different configuration. This could live alongside the current plugin type and provide some conveniences for developers doing something custom.

    • gausarts committed c8e3e499 on 2.0.x
      Issue #3409579: splide-minimal.html.twig used for non-vanilla display
      
  • Status changed to Fixed 8 months ago
  • 🇮🇩Indonesia gausarts

    The doc comments below @file line actually mentioned the dual usages for both vanilla and navigation.
    However I agreed to update @file comment as suggested.

    Regarding template overrides, you can do regular copy procedures into your theme.
    Just be sure to keep the relevant conditions as recommended in the doc comment top distinguish Vanilla from navigation.

    In case misunderstood, unlike Slick, Splide supports navigation within Vanilla as documented in project home as long as Thumbnail style or Thumbnail caption is provided. I understand this might confuse you. However the current approach is a more simplified version of Slick's while having more advanced features.

    More betterment is always welcome should you have one.

    Thank you for contribution.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024