WordPress / twentytwentytwo

Twenty Twenty-Two, the default WordPress theme that will launch with WordPress 5.9.
405 stars 92 forks source link

Try and place patterns in default categories instead of declaring our own #267

Closed kjellr closed 2 years ago

kjellr commented 3 years ago

Currently, Twenty Twenty-Two declares five new pattern categories:

Most of these categories should/will/do exist in Gutenberg by default, and it would be great if we could hook into them automatically rather than declare our own duplicate, lengthy category names.

For example, it would be ideal if we could just place our theme header patterns in the normal "Headers" category, and have them show up before the default set.

Screenshot

Screen Shot 2021-11-30 at 12 57 38 PM
shaunandrews commented 3 years ago

I've seen it mentioned a few times that perhaps we should group these categories by the way their created; Having a "Twenty Twenty-Two" section or a "Coblocks" section, but this still leads to having duplicate categories like in the mockup below:

image

it would be ideal if we could just place our theme header patterns in the normal "Headers" category, and have them show up before the default set.

Agreed 100%. I think we can even go a little further and highlight the theme-recommended patterns at the top of the grid:

image

Then, the sidebar can show an item for the theme's patterns along with items any plugin provided patterns — this avoids having duplicated categories, and keeps the list clean.

ndiego commented 3 years ago

I have some ideas how this all could functionally work. Will work on getting that more formalized this week.

kjellr commented 2 years ago

I took a stab at adding these to the default categories in the theme itself. A couple observations:

ryelle commented 2 years ago

"Headers" is a core category, so it should work- the slug is header, though. Other than that, the approach in #284 looks good to me.

kjellr commented 2 years ago

Ha, thank you for catching that! I'll give it a try. 🙌