Kirby Gallery Field

Hey @timoetting I think I’ve fixed the issue with the multiple galleries in your plugin.
In your code I replaced every line where you’re using something like this

$('.galleryField__items--sort .galleryField__item', element)

to something like this : container.find('.galleryField__items--sort .galleryField__item')

Where container is a variable defined inside the scope of the on event : $(this).closest('.field-grid-item')

This way all the events are limited to the single gallery.
I’m not gonna do a pull request because you can for sure fix it in a better way, I just looked for a quick way to fix it but you can probably find a better and more elegant solution.

I tested the code on my local installation and is working perfectly

1 Like

@manuelmoreale thanks a lot for this solution. I will take a closer look at you approach during the next days.

1 Like

I’m experiencing difficulties with gallery field.
I have multiple galleries on one page.
and my blueprint looks like this:

title: Homepage
files: true
fields:
  title:
    label: title
    type: text
    required: true  
  gallery1:
    label: gallery1
    type: gallery
    required: true
  gallery2:
    label: gallery2
    type: gallery
    required: true
  gallery3:
    label: gallery2
    type: gallery
    required: true

The thing is when I’m adding pictures to one gallery it adds same pictures three times. how can i solve it? thank you

@katialove: Yeah, I also had this issue. You could try the solution suggested by @manuelmoreale.

Please use Markdown code blocks when posting code in the forum to preserve indentation. I have corrected it for you above. :slight_smile:

I’ll clone the repo and push my version tomorrow morning when I’m back in front of my mac. Just as a temporary fix untill @timoetting finds the time to fix the bug in the official version :wink:

@katialove here’s my fork of @timoetting gallery https://github.com/manuelmoreale/kirby-gallery
Is working just fine on my installation but use this just as a temporary fix :wink:

Edit: the only different file is the gallery.js inside assets/js/

thank you for your help.

ok, thank you. will do next time

I fixed the problem with multiple galleries on one page. Thanks @manuelmoreale for the temporary fork :+1:.

3 Likes

Hey Tim,
thanks for the plugin!
I initially set up the plugin with the aspectRatio: 1:1 option and created some galleries. Now I decided that I would like to see the aspect ratio in the backend, so I deleted the aspectRatio line from the blueprint. Sadly, all galleries are faulty and empty now in the panel (frontend still works though). Any way to fix this without deleting all galleries?

Ou, strange bug!

Did you try to delete the corresponding thumbnail files of your page inside the thumbs folder so that the thumb script runs over the images again?

Nope, just tried that but doesn’t change anything. It’s not that much of a problem since once I add the aspectRatio again everything works just fine. I’m still on Kirby 2.2.3 btw, could that be the problem?

Hello!
Is it possible to fetch images from other pages?
Thanks!

No, this is not possible yet.

Hi Mungle,

I’ve created a widget that pulls content from all pages. The widget allows you to create new pages and assign media to a field on the created page or multiple existing pages. I plan on releasing this as a standalone plugin soon if this would fit your needs?

It also has gif previews for video and soundwave previews for audio, maybe a bit extra functionality but it’s most definitely doable, also all the functionality of the gallery field but more.

.

1 Like

Looks like what you need is a list of comma separated URLs, not an array? What do you need the counter for?

What is the name of the field that contains the picture? What does it contain? The name of the file or the url?

3 posts were merged into an existing topic: Multiple Image change on mouseover

This plugin works with multiple galleries and is less buggy :

2 Likes