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

Inserter: Iterate on pattern categories #47847

Open
annezazu opened this issue Feb 7, 2023 · 18 comments
Open

Inserter: Iterate on pattern categories #47847

annezazu opened this issue Feb 7, 2023 · 18 comments
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Pattern Directory The Pattern Directory, a place to find patterns [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Enhancement A suggestion for improvement.

Comments

@annezazu
Copy link
Contributor

annezazu commented Feb 7, 2023

While #47760 (comment) 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

@annezazu annezazu added [Type] Enhancement A suggestion for improvement. [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Feature] Pattern Directory The Pattern Directory, a place to find patterns labels Feb 7, 2023
@richtabor
Copy link
Member

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.

@richtabor
Copy link
Member

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

@jameskoster
Copy link
Contributor

Good question. Should Gallery and Media be merged? It seems fairly likely that the images in a Gallery pattern would be interchangeable with video.

@leutrimhusaj
Copy link
Contributor

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.

@richtabor
Copy link
Member

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.

@jameskoster
Copy link
Contributor

Yeah that might work. In that sense I suppose media could be a tag?

@richtabor
Copy link
Member

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?

@annezazu
Copy link
Contributor Author

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.

@richtabor
Copy link
Member

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:

CleanShot 2023-03-27 at 16 45 41

@mtias
Copy link
Member

mtias commented Jun 29, 2023

@annezazu @richtabor where are we on this?

@richtabor
Copy link
Member

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.

@annezazu
Copy link
Contributor Author

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.

@glendaviesnz
Copy link
Contributor

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?

@annezazu
Copy link
Contributor Author

annezazu commented Oct 5, 2023

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 :)

@aaronrobertshaw
Copy link
Contributor

Thanks for flagging the new categories @annezazu 👍

Should the proposed categories, Images, Videos, and Audio, replace the existing core Media category?

@annezazu
Copy link
Contributor Author

That's correct ^. Thanks for the patience (focused on 6.4 at the start of this week).

@aaronrobertshaw
Copy link
Contributor

There's a PR up (#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?

@richtabor
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Pattern Directory The Pattern Directory, a place to find patterns [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Enhancement A suggestion for improvement.
Projects
No open projects
Status: Backlog
Development

No branches or pull requests

7 participants