Add URL Hash Navigation to Nestable Slider element

Hi !

Could it be possible to add a url hash to each slide in the Nestable Slider Element (like in BricksExtras premium plugin) ?

So we could redirect from a URL in a page (A) to a specific slider slide in another page (B).

I think there’s an extension to do that :

https://splidejs.com/extensions/url-hash/#09

Have a nice day !

UPDATE :

After a lot of failures, i managed to mount the SplideJS extension to in existing Slider element.

Here’s the code i used :

<script src="
https://cdn.jsdelivr.net/npm/@splidejs/splide-extension-url-hash@0.3.0/dist/js/splide-extension-url-hash.min.js
"></script>

<script>
document.addEventListener('DOMContentLoaded', (event) => {
  setTimeout(() => {
    const instance = window.bricksData?.splideInstances['sliderID'] || false
    instance.destroy(true);
    instance.mount(window.splide.Extensions);
  }, 250)
})
</script>

The code above is placed in a code element in the same page as the slider element.
Don’t forget to replace ā€˜SliderID’ with the ā€˜data-script-id’ value of your own slider.

It seems that the timout is mandatory, it’s not working anymore if i remove it.

EDIT :

Finally succeed to implement it ! I made a quick tuto in ā€œHow toā€ section!

https://forum.bricksbuilder.io/t/redirect-from-one-page-to-a-specific-slide-using-splidejs-url-hash-navigation-in-another-page/15482/2