cajames / kirby-editor-gallery-block

A gallery block for the Kirby Editor
MIT License
61 stars 5 forks source link

Different appearance in the backend #4

Closed medienbaecker closed 2 years ago

medienbaecker commented 4 years ago

I noticed you calculate the widths and number of images in the rows automatically. Depending on where you want to go with this plugin it would make sense to optionally have a simpler image group without set widths — for example when using the block as a slideshow. Or do you think it would be better to create a fork for something like that?

It might actually be enough to make the batchRatioLimit variable editable via an option: https://github.com/cajames/kirby-editor-gallery-block/blob/master/src/components/Gallery.vue#L209

cajames commented 4 years ago

Hey @medienbaecker, thanks for that! It's a good idea.

We could definitely make the batchRatioLimit modifiable if it suits a use case. The batchRatioLimit value is only used at image insert time, and people can drag as many images as they choose into a row after.

For the example of a slideshow/carousel, I think it could be added to this, though having it in its own Slideshow block is not a bad idea either.

For clarity, when talking about slideshows, I'm imagining an end product like this:

2020-06-18 21 16 12

If we were to build it as part of this module, I think we can consider a few things:

Though we'd probably need to add JS and CSS to make a slideshow render work as expected on the client UI. I'm hesitant to add JS as part of the rendered markup, I'd ideally just want a clean HTML block which the user can enrich with their own CSS and JS.

What are your thoughts on this? Would be great if we could find a good solution to add slideshows to the Kirby Editor. :)

medienbaecker commented 4 years ago

Great input, thanks for that!

On the one hand I think editor blocks can totally look different in the backend — especially if it's easier to edit. On the other hand there's the use case of multiple different versions of the gallery block. E.g. once as a slideshow, and multiple galleries. For that we would definitely need a type attribute.

For my use case (articles on https://www.praeposition.com/text/vorzeichen/joseph-vogl) it would be more than enough to globally display the images next to each other in the backend and render the slideshow in the frontend.

cajames commented 4 years ago

On the one hand I think editor blocks can totally look different in the backend — especially if it's easier to edit.

Actually I think I've warmed to your idea, especially considering something like the Kirbytext block.

For my use case (articles on praeposition.com/text/vorzeichen/joseph-vogl) it would be more than enough to globally display the images next to each other in the backend and render the slideshow in the frontend.

Okay how about this implementation in #9? This way you can disable the auto-layout for the block, and then add as many images to it as you wish.

This will hopefully give us more time to build the type mechanic, while in the meantime also solving your use case. 😊

medienbaecker commented 4 years ago

@cajames That's awesome! You even added a perfect German translation 👏

Do you think it would be easily possible to make the default (auto layout true or auto layout false) globally editable via an option?

Thanks so much for your work, it really helps a lot for this project!

cajames commented 4 years ago

Thank you!

You even added a perfect German translation 👏

Haha I can't take credit, Google Translate did the work 😝

Do you think it would be easily possible to make the default (auto layout true or auto layout false) globally editable via an option?

Actually that's a great idea! I haven't looked into implementing global settings, but given this is just a regular plugin, I'm sure I should be able to access the global Kirby config, and set an option for this.

Let me have a look and I'll get back to you. 😊

medienbaecker commented 4 years ago

@cajames You should add a donation/sponsoring link to the repository 🙏

mynameisfreedom commented 4 years ago

@cajames You should add a donation/sponsoring link to the repository 🙏

Yes, you should. 😎