0

I've create custom blocks for my client's theme and I want the title of the block to show after it's been added so that they can see which blocks have been used. This way they know how to recreate the layouts moving forward.

Is this possible?

0

I want the title of the block to show after it's been added so that they can see which blocks have been used.

This information is already available and displayed in multiple places, for example

When hovering over a block:

enter image description here

In the sidebar when the block is selected:

enter image description here

In the breadcrumb bar at the bottom:

enter image description here

And highlighted in the block navigation list dropdown menu:

enter image description here

If the goal is to be able to recreate the layout, you could set up a template for that post type when calling register_post_type so that it's pre-filled and they just modify it how they like. You can even set them up as placeholders, or force the layout and blocks available.

You can also copy paste the blocks all at once from another page. Just shift + click to select multiple blocks then copy paste. There's also a copy all content link in the top right 3 dot menu

You can also use plugins such as the site editing plugin from Automattic, and others, to provide pre-filled options

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.