Kirby Gallery Field


#21

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


#22

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


#23

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


#24

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


#25

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


#26

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:


#27

@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/


#28

thank you for your help.


#29

ok, thank you. will do next time


#30

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


#31

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?


#32

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?


#33

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?


#34

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


#35

No, this is not possible yet.


#36

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.

.


#38

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?


#39

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


#40

This plugin works with multiple galleries and is less buggy :