WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.54k stars 4.21k forks source link

Media workflows around patterns #58172

Open mtias opened 10 months ago

mtias commented 10 months ago

It should be easy to replace all images in a pattern or set of patterns with images from the media library or a new set of uploads. Some of the following scenarios seem worth exploring:

andrewserong commented 10 months ago

Just jotting down a quick thought/idea for how part of this might work (implementation-wise) for replacing multiple images at once:

Could the behaviour with the media library / media selection work in a way where it doesn't need to be aware of patterns per se, but given a list of selected blocks, it figures out which ones are image blocks, counts how many, and in the media library, allows you to replace up to that many of the image blocks with another selection of media items?

That way the same "replace" behaviour could work if a pattern is selected, or if a user does a selection of, say, 3 images in a Gallery block, or part of a post or page that contains several image blocks.

ramonjd commented 8 months ago

Could the behaviour with the media library / media selection work in a way where it doesn't need to be aware of patterns per se, but given a list of selected blocks, it figures out which ones are image blocks, counts how many, and in the media library, allows you to replace up to that many of the image blocks with another selection of media items?

This sounds like a good abstraction. It could then work with any pattern, or even site. For the latter, I'm guessing it could make a site-building AI assistant's role easier by allowing it to respond to requests such as "replace all the images with ones that have flowers in them".