gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Allow third party to feature its own blocks in the link control panel

Open Hug0-Drelon opened this issue 3 years ago • 1 comments

What problem does this address?

For the moment, the list of available blocks in the transform section of the link control panel is hardcoded here. It's not possible for a third party plugin to feature a custom block for navigation.

There is still a workaround by adding a random link and transforming it into another kind of block. But from a user point of view it is not convenient at all.

Some context and practical example

Let's take a concrete case with Polylang Pro which provides a language switcher for the navigation block. Unfortunately users can't add it without performing a transform operation on a link block See bellow what's currently displayed in the transform control panel: Capture d’écran 2022-03-28 à 15 52 44 There is no way to easily transform a link into a block other than core/site-logo, core/social-links or core/search.

Instead it would be great to feature our language switcher block like this: Capture d’écran 2022-03-28 à 15 51 28 Users will now be able to easily add our block.

Proposed solution

It would be great to open this block list, with a new filter for instance. With such a filter we could easily add blocks.

Maybe linked to this issue https://github.com/WordPress/gutenberg/issues/33278

Hug0-Drelon avatar Mar 28 '22 15:03 Hug0-Drelon

Wouldn't it be better if the language switcher could be directly (somehow) inserted in the menu, instead of inserting a link first and transforming later?

draganescu avatar Apr 01 '22 18:04 draganescu