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

Block Patterns: Add category for banners #44203

Merged
merged 2 commits into from
Sep 19, 2022

Conversation

mcsf
Copy link
Contributor

@mcsf mcsf commented Sep 15, 2022

Fixes #40116

What?

Register a new category for block patterns named "Headings & Titles" "Banners".

Why?

See the parent issue. With this new category, we can clarify the categorisation of patterns as "Headers". Category "Headers" pertains to global patterns meant to sit at the top of a page ("the header of the site"), while category "Banners" pertains to typically visually distinctive elements that help structure or contrast the contents of a page (including headings and "hero" elements).

@mcsf mcsf added [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs PHP backport Needs PHP backport to Core labels Sep 15, 2022
@mcsf mcsf requested a review from annezazu September 15, 2022 16:11
@annezazu annezazu added the Backport to WP 6.6 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Sep 15, 2022
@annezazu
Copy link
Contributor

annezazu commented Sep 15, 2022

cc @ryelle as I'm not sure what might be needed from the pattern directory POV :)

Edited to add: sorry, I totally was behind on the comments in the original issues and see you've chimed in there. Thank you!

@annezazu
Copy link
Contributor

In terms of naming, seems in the original issues we're leaning more towards "Banners". I'd personally shy away from "Hero" as I don't know if that will translate well. I do think it'll help to distinguish if we stay away from Headings since that still feels so similar to Headers.

// Register categories used for block patterns.
$pattern_category_registry = WP_Block_Pattern_Categories_Registry::get_instance();
if ( ! $pattern_category_registry->is_registered( 'heading' ) ) {
register_block_pattern_category( 'heading', array( 'label' => __( 'Headings & Titles', 'gutenberg' ) ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this Hero or Banner instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Anne points out, "Banners" might work better across locales, and — to me — feels less like jargon than "Hero". But I don't feel strongly about this. You?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super

@mcsf mcsf changed the title Block Patterns: Add category for Headings & Titles Block Patterns: Add category for banners Sep 16, 2022
@mcsf
Copy link
Contributor Author

mcsf commented Sep 16, 2022

Updated.

@mtias, @annezazu: 👍 ?

@mcsf
Copy link
Contributor Author

mcsf commented Sep 16, 2022

Fixes #40116

With this new category, we can clariy the classification of patterns as
"Headers". Category "Headers" pertains to global patterns meant to sit
at the top of a page, while category "Headings & Titles" pertains to
typically visually distinctive elements that help structure the contents
of a page.
@mcsf mcsf force-pushed the add/patterns-category-headings-and-titles branch from 790b97c to 8b4c879 Compare September 16, 2022 16:00
@ryelle
Copy link
Contributor

ryelle commented Sep 16, 2022

The applicable patterns I see in my sandbox all come from the directory

We can create the same category in the Pattern Directory when this merges, and move those patterns. I think that will make them "uncategorized" on older WordPress installs though, will that be a problem?

@mcsf
Copy link
Contributor Author

mcsf commented Sep 19, 2022

We can create the same category in the Pattern Directory when this merges, and move those patterns. I think that will make them "uncategorized" on older WordPress installs though, will that be a problem?

I think that will be fine. The alternative that I can think of is to add both categories to those patterns, which IMO beats the purpose of the new category.

@mcsf mcsf merged commit 4fa05b8 into trunk Sep 19, 2022
@mcsf mcsf deleted the add/patterns-category-headings-and-titles branch September 19, 2022 14:07
@github-actions github-actions bot added this to the Gutenberg 14.2 milestone Sep 19, 2022
ockham pushed a commit that referenced this pull request Sep 19, 2022
* Block Patterns: Add category for Headings & Titles

Fixes #40116

With this new category, we can clariy the classification of patterns as
"Headers". Category "Headers" pertains to global patterns meant to sit
at the top of a page, while category "Headings & Titles" pertains to
typically visually distinctive elements that help structure the contents
of a page.

* Rename to "Banners"
@ockham
Copy link
Contributor

ockham commented Sep 19, 2022

I just cherry-picked this PR to the wp/6.1 branch to get it included in the next release: 53b0f84

@ramonjd ramonjd removed the Needs PHP backport Needs PHP backport to Core label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvements to Header pattern category to better clarify and guide usage
7 participants