Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple image selections with default media library #10

Open
frankbits opened this issue May 8, 2023 · 6 comments
Open

Support multiple image selections with default media library #10

frankbits opened this issue May 8, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@frankbits
Copy link

- { name: "img", label: "Image", widget: image, allow_multiple: true }

The allow_multiple-option of the image-widget seems to not be supported.
Or just the media-library does not support multiple-selection, which would make the option in line with the decap-cms-Doc

allow_multiple: (default: true) when set to false, multiple selection will be disabled even if the media library extension supports it

@kyoshino
Copy link
Member

kyoshino commented May 8, 2023

The allow_multiple option is only for external media libraries like Cloudinary and Uploadcare, which are not supported yet in Sveltia CMS. Well, I know there is an issue with Netlify/Decap CMS for supporting the option with the default media library. I’ll take care of it after adding support for external libraries and understanding the behaviour.

@kyoshino kyoshino added the enhancement New feature or request label May 8, 2023
@kyoshino
Copy link
Member

kyoshino commented May 8, 2023

Let me clarify: it seems the allow_multiple option is for disabling multiple selections in an external media library. As the Decap CMS doc suggests, if you want to enable multiple selections in a media library, the configuration would look like this:

  - label: "Featured Image"
    name: "thumbnail"
    widget: "image"
    choose_url: true
    default: "/uploads/chocolate-dogecoin.jpg"
    media_library:
      config:
        multiple: true

Either way, this is not yet supported by the default media library both in Decap CMS and Sveltia CMS.

@kyoshino kyoshino changed the title allow_multiple-option of the image-widget not working Support multiple image selections with default media library May 8, 2023
@ekin04
Copy link

ekin04 commented Nov 7, 2024

First thanks for your work!
i have try to implement a multi image, in decap is ok i can put more image, but sveltia ui can't do

image

image

@kyoshino
Copy link
Member

kyoshino commented Nov 7, 2024

Does it actually work in Decap? decaporg/decap-cms#6730 is closed as duplicate but is not fixed yet, I think. It should work in Decap if Cloudinary is configured as the media library, though there is a bug: decaporg/decap-cms#5812

@ekin04
Copy link

ekin04 commented Nov 7, 2024

sorry my bad, i have try fast with decap

backend: name: test-repo

and here the ui work good, but when use other backend we have the same problem

@kyoshino
Copy link
Member

kyoshino commented Nov 7, 2024

Ah the Test backend. I see.

I’ll work on this anyway, but multiple image selection is not recommended because generally each image should have an alt text for accessibility and SEO. You can instead use the List widget:

      - name: thumbnails
        label: Featured Images
        widget: list
        fields:
          - name: src
            label: Source
            widget: image
          - name: alt
            label: Alt Text
            widget: string

@kyoshino kyoshino pinned this issue Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants