-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
What problem does this address?
There is a growing need for template parts that render across the site (Cookie consent widget, newsletter subscription blocks, possible chat widgets, etc…). I consider these UIs to be distinctive from blocks because they're meant to manipulate the experience, and are not part of the content of the site. Let's call them meta UI.
Template parts are a great way to store and customize these. TPs are isolated from the content and don't interfere with the other user pages and content, and they can be easily rendered on the frontend of the site with some simple actions.
The only problem is that ALL template parts are available in the inserter. This defies the purpose and allows users to add these special parts in random places on the site, thus ruining the distinction between content and meta UI.
What is your proposed solution?
Just like blocks, template parts should have a configurable inserter prop. This would allow theme developers (and not only) to make customizable parts that don't mix up with the content of the site. FWIW, at WordPress.com, we're ready to ship a Cookie Consent Block and Newsletter subscription block as soon as this feature lands.
Thanks a lot!