WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.54k stars 4.21k forks source link

Inline reusable block #19379

Open strarsis opened 4 years ago

strarsis commented 4 years ago

Is your feature request related to a problem? Please describe. Sometimes only a piece of text should be reused in Gutenberg, or some inline content, e.g. text with inline images. With the current reusable Gutenberg block this isn't possible, as they work only with whole blocks.

Describe the solution you'd like

Describe alternatives you've considered Currently I use a Reusable Text Blocks plugin and shortcodes for reusing text. But the new Gutenberg editor is an opportunity to get rid of all other workarounds like shortcodes.

youknowriad commented 4 years ago

Hi There!

Gutenberg already support custom inline formats which can be used as a replacement for inline shortcodes.

strarsis commented 4 years ago

@youknowriad: So let's say I want to re-use a piece of text 10 times on 10 different pages. How can I create a reusable Gutenberg block for this piece of text and then place that reusable block inline into a e.g. paragraph? I don't think this is possible.

youknowriad commented 4 years ago

Yes, that's not possible currently. One could use the Format API to store these inline fragments in a custom CPT or something but it's quite a bit of work and if it were to be implemented in Gutenberg, it will probably be done the same way.

tomaswallentinus commented 4 years ago

The reusable block is awesome, I used a plugin for that before, but to use it inside a p or li would be very useful.