processwire / processwire-requests

ProcessWire feature requests.
39 stars 0 forks source link

Ability to disable individual image items in a multiple images field #520

Closed jlahijani closed 4 months ago

jlahijani commented 4 months ago

With repeaters, you have the ability to disable an individual repeater using the toggle it provides.

It would be nice if you could do this with multi-image fields (and multi-file fields), although I can understand why this may not be implemented since repeaters are technically repeater pages under-the-hood while images and files are not which complicates things.

Right now I'm using custom image fields and have a checkbox field called 'disabled', although checking it won't give me the nice greyed-out effect like repeaters do. I'll figure that out with a hook however.

Anyway thought I'd bring this feature up and see your thoughts about it.

ryancramerdesign commented 4 months ago

@jlahijani I've also wanted this on a few occasions. I have added it. The API side of it works for file or image fields, but on the interactive side, I've just added it to InputfieldImage for now, and likely will add to InputfieldFile later. To hide an image, use the Actions menu and select "Hide". To unhide, do the same, selecting "Unhide". When an image is hidden, it is excluded from the formatted value of the images field.