Inserter: Iterate on pattern categories
While https://github.com/WordPress/gutenberg/pull/47760#issuecomment-1419332542 was a start in reorganizing the patterns, it seems I missed a few that are bundled into Core. Let's use this issue to discuss how best to order the remaining categories over time as they are added to the pattern directory: https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/block-patterns.php#L39-L158
Here's one proposed order:
Featured Posts Text Gallery Media Call to Action About Banners Contact Portfolio Services Team Testimonial Headers Footers
Leaving out Columns and Buttons since afaik those were adapted to Text and Call to Action respectively. @WordPress/gutenberg-design for more thoughts along with @richtabor
Media
Perhaps not the proper place to call out, but if "Media" is "Different layouts containing video or audio", maybe we just call it "Audio & Video"?
At first glance I was wondering why we have Media and Gallery.
Only thing I'd change is swapping "Banners" and "About" so that the more page-specific patterns are all together:
Featured Posts Text Gallery Media Call to Action Banners About Contact Portfolio Services Team Testimonial Headers Footers
Good question. Should Gallery and Media be merged? It seems fairly likely that the images in a Gallery pattern would be interchangeable with video.
Why should the pattern categories have a "specified" order? Could we prevent a default order and be able to change the order, especially if plugin developers add other categories that should be handled in the "correct" order.
Good question. Should Gallery and Media be merged? It seems fairly likely that the images in a Gallery pattern would be interchangeable with video.
What about "Images", "Videos", and maybe "Audio" split out separately? When you think about what you want to add, "I want to add media to this page" wouldn't be the first thought. The "Images" category could have images, columns of images, galleries, etc — it doesn't have to be block-based, but element-based.
Yeah that might work. In that sense I suppose media could be a tag?
What about "Images", "Videos", and maybe "Audio" split out separately? When you think about what you want to add, "I want to add media to this page" wouldn't be the first thought. The "Images" category could have images, columns of images, galleries, etc — it doesn't have to be block-based, but element-based.
What do you think @annezazu?
Thanks for the patience! What a tricky problem. I'm game to see three categories split out. My instinct is to keep things as concise as we can while leaving options open though. Thinking more broadly, we do have a Media tab now with 6.2 in the Inserter so we also want to prevent confusion there.
Thinking more broadly, we do have a Media tab now with 6.2 in the Inserter so we also want to prevent confusion there.
Good point.
Some notes while cleaning/recategorizing the WordPress.org-authored patterns:
- I found myself wanting to categorize via media type (image, video, audio). If there's not a catch all "Media" category (which I don't think is a good idea) then audio/video don't really have a place — other than within other sorts of patterns, i.e. a Banner pattern with a video.
- Gallery and Portfolio will have a lot of crossover, but that's probably fine. Perhaps over time Portfolio can be more portfolio page patterns, and less gallery-centric.
- Just noting a number of the new categories are missing on the directory:

@annezazu @richtabor where are we on this?
I'd say it's in a good place. Follow-up would be perhaps adding "Video" and "Audio" categories, in lieu of "Media" — though we don't have many patterns for those categories at the moment.
Right now, this issue is open to determine categories over time if/when we add patterns to these categories and they are added to the pattern directory. As a result, I wouldn't close just yet since it won't become relevant until we add.
With the addition of user categories we have switched to a simple alpha sort of the pattern categories otherwise it was confusing for users trying to find their categories in what appeared to be a random ordering. So, shall we close this?
Chatting with @richtabor about this today to loop back and with the addition of some Core patterns, like this, having the "Images" category, wanted to note as something to iterate on next with this work. In particular, let's add Images, Videos, and Audio categories.
cc @aaronrobertshaw for future reference :)
Thanks for flagging the new categories @annezazu 👍
Should the proposed categories, Images, Videos, and Audio, replace the existing core Media category?
That's correct ^. Thanks for the patience (focused on 6.4 at the start of this week).
There's a PR up (https://github.com/WordPress/gutenberg/pull/55236) introducing the new pattern categories into Gutenberg (I'll backport that once it settles).
I have a follow-up question though about the proposed removal of the Media category. It's possible now that themes have patterns that have been assigned to the Media category so this would be a breaking change.
If Media is removed and a pattern has no other categories assigned to it, the pattern would then only appear under the "uncategorized" category. If the pattern had other category assignments it would be shown there instead.
@annezazu or @richtabor do you have any thoughts on this?
I think it's fine to leave in. We can just make sure patterns in the directory don't use the "Media" category, so that the category doesn't render in the inserter (as empty categories are omitted).