Splide Carousel Block

Deskripzioa

The Splide Carousel block introduces the capability to create carousels/sliders within the block editor. Each carousel may contain an infinite number of slides, with each slides containing their own inner blocks.

Use the Splide Carousel block to create image carousels, testimonial rotators, and more in Gutenberg!

View Demo

Options

  • Arrows Navigation
  • Dots Pagination
  • Autoplay
  • Slide and Fade Transitions
  • Infinite Loop
  • API to control the carousel using JavaScript
  • Fixed Slide Width / Height
  • Variable Slide Width / Height
  • Number of Slides Per Page
  • Slide Spacing
  • Video Support
  • Auto Scroll
  • Hash Navigation
  • Lazyload
  • FSE (Full Site Editing) Compatible
  • Fully Accessible
  • RTL Support
  • Responsive
  • No Google Lighthouse Issues
  • Lightweight
  • …and more!

Attribution

The Splide Carousel block uses the Splide library.

Pantaila-argazkiak

  • Block editor view
  • Block editor view
  • Front end view
  • Front end view
  • Block controls

Blokeak

Plugin honek 2 blokeak eskaintzen ditu.

  • Splide Carousel
  • Splide Carousel Item

Instalazioa

  1. Upload the plugin files to the /wp-content/plugins/splide-carousel directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress

MEG

Are there additional options I can use?

Yes, under the Splide Carousel block Advanced Settings, you can provide a valid JSON string containing additional options located here.

e.g.: {"focus":"center","trimSpace":false}

Can I set default carousel options globally?

Yes, we need to listen to a JavaScript event that is fired when the carousel is ready, and then add the defaults.

document.addEventListener( 'splideReady', function( e ) {
    e.detail.defaults = {
        arrowPath: 'M30.2 19.4L11 .2c-.3-.3-.9-.3-1.2 0-.3.3-.3.8 0 1.2L28.4 20 9.8 38.6c-.3.3-.3.9 0 1.2.3.3.9.3 1.2 0l19.2-19.2c.3-.3.3-.9 0-1.2z',
        perPage: 3
    };
} );

Can I control the carousel using JavaScript / API?

Yes, each carousel is given a unique ID by default, or you can provide your own using the HTML Anchor field under the block Advanced Settings.

Each block exposes a global variable that follows this convention: {ID}Carousel. For example, if your carousel ID is testimonials, the global variable will be testimonialsCarousel.

Using this global variable, you can control the carousel programatically using the Splide API.

Example to navigate to the third slide:

testimonialsCarousel.Components.Controller.go(2);

Berrikuspenak

2023(e)ko azaroaren 25(a) 1 reply
This plugin is very useful. I hope developers continue to support this.
2023(e)ko urriaren 23(a)
Wonderful plugin, simple and lightweight - great support too
2023(e)ko irailaren 17(a)
Perfect implementation! It's exactly what I was looking for, well it's even more. Thank you a ton!
2023(e)ko otsailaren 25(a)
Nicely integrated with the block editor. Fantastic support.
2023(e)ko urtarrilaren 10(a) 1 reply
Nice block extension. One wish I have is to have the possibility to combine this with the Query-loop block. Then you can iterate all featured images within a custom post type.
Irakurri 5 berrikuspenak

Laguntzaileak eta Garatzaileak

“Splide Carousel Block” software librea da. Ondoko pertsonek egin dizkiote ekarpenak plugin honi.

Laguntzaileak

Aldaketen loga

1.4.4

  • Fix – Carousel JavaScript variable name duplicating “Carousel” in the name

1.4.3

  • Fix – HTML Anchor not applying to carousel

1.4.2

  • Fix – Prevent autoplay and auto scroll in block editor

1.4.1

  • Docs – Update tested up to

1.4.0

  • Enhancement – Improved editor UX
  • Enhancement – Added ability to make entire slide clickable link

1.3.0

  • Enhancement – Added Grid extension
  • Enhancement – Added autoplay play/pause buttons

1.2.0

  • Enhancement – Added Inspector Controls to avoid having to use JSON
  • Enhancement – Exposed global variable to programatically control the carousel using the Splide API

1.1.0

  • Enhancement – Ability to add photos in bulk when new block is created and when block has no slides

1.0.0

  • Initial release