Mittul At TechnoBrave
Mittul At TechnoBrave

Reputation: 1242

OctoberCMS admin delete multiple photos from UI

I have one quick question in OctoberCMS , if OctoberCMS provides this feature in admin backend in UI.

I have created plugin and added this field Photos (png,jpg): there.

fields.yaml

photos:

            label: 'Photos (png,jpg):'

            mode: image

            fileTypes: 'jpeg,jpg,png'

            useCaption: true

            thumbOptions:

                mode: crop

                extension: auto

            span: left

            required: 1

            type: fileupload

            tab: 'Property Information'

And here is the screenshot of this field how its looking like.

enter image description here

Plugin and functionality working fine. But I want an option if I can delete multiple images at once. Something like Select All checkbox and Delete Button and a Checkbox beside each photo. Currently I need to remove one after another.

I have researched and could not find any core solution from OctoberCMS side.

Is it possible ? or do I need to create a code and make a functionality altogether for this ? any suggestions ?

Thanks

Upvotes: 2

Views: 212

Answers (1)

Hardik Satasiya
Hardik Satasiya

Reputation: 9715

core will not provide this things you need to develop at your own

instead adding partial its wise to use custom form widget so you can use them else where also.

this guide will help you to build one

https://octobercms.com/docs/backend/widgets#form-widgets (Form Widgets Section)

after that you can use it inside form_config.yaml

pics:
    label: Your Pics
    type: myCustomewidget
    ... options

and you can reuse it, as well you can add your js, css and partials(html) separately dedicated to widget as you wish

Upvotes: 1

Related Questions