WordPress / community-themes

A collection of Block Themes built by the WordPress community.
80 stars 33 forks source link

Utilise Pattern for search form #71

Closed getdave closed 1 year ago

getdave commented 1 year ago

This PR unifies all instances of the search form into a single Pattern.

Some instances requires wrapping in a Group block to provide the original 75% constrained width.

Side note/rant: it's really not at all intuitive to set this width in the UI on the Group block.

Part of work towards https://github.com/WordPress/community-themes/issues/11

carolinan commented 1 year ago

What is the benefit of creating a pattern with one single block? (Theme patterns are not synced)

getdave commented 1 year ago

What is the benefit of creating a pattern with one single block? (Theme patterns are not synced)

I saw it as a maintenance things for developers. When I used to make classic themes I would have the search form as a template include. This is basically the same thing...apart from the syncing piece you mentioned.

I'm not particularly wedded to this approach so if it's not "the way things are done" then I'm happy to be advised as such 🙇

carolinan commented 1 year ago

If we want it to sync it could be a template part, but template parts does not have an "inserter no" option.

The benefit of a pattern is that text can be translated, but this pattern does not use translation functions around the Search label.

MaggieCabrera commented 1 year ago

Generally we try to avoid doing things just because it's more comfortable for devs if they may confuse the users. Like Carolina said, the pattern will be visible for them and don't make much sense on its own

getdave commented 1 year ago

Cool. Let's close this then 👍