VolgaIgor / editorjs-gallery

Gallery block for Editor.js with multi-loading and sorting
MIT License
9 stars 6 forks source link

Ability to add a carousel. #1

Closed adampatterson closed 1 year ago

adampatterson commented 1 year ago

It would be nice to have the option to flag a Gallery block as a carousel.

VolgaIgor commented 1 year ago

It would be nice to have the option to flag a Gallery block as a carousel.

Hello! I am sorry that i not answering so long, I didn't see the message.

If I understand correctly, you want the tool to be displayed in the list as "Carousel", not as "Gallery". You can do this with the standard editor features: https://editorjs.io/i18n/

Need to add this code to the config:

i18n: {
    messages: {
        toolNames: {
            'Gallery': 'Carousel'
        }
    }
}
adampatterson commented 1 year ago

Hello @VolgaIgor sorry no,

In my implementation I am using the gallery in an article. I thought it would also be nice to have the option to insert a Carouse.

The admin interface would be basically identical but when saving the data I'd need a way to tell if I inserted a gallery or a carousel.

Hope that helps.

VolgaIgor commented 1 year ago

@adampatterson I still don't fully understand your idea) What is "Gallery", what is "Carousel"?

Now the module has additional switches, "slider" and "fit". I meant by them that "slider" is horizontally scrolling slides with pictures, and "fit" is image tiles: изображение_2023-06-28_115543058 Readme says about them, maybe you need it? Titles "Slider" and "Fit" can also be changed with the internationalization tools of the editor.

Or maybe you want two blocks with the same functionality, but with different IDs. Then you just need to include them twice in the configuration with different IDs:

gallery: {
    class: ImageGallery,
},
carousel: {
    class: ImageGallery,
}
adampatterson commented 1 year ago

Thanks @VolgaIgor, I did not see that in the readme but that is exactly what I want.

I call sliders carousels 😂