DEV :: Drupal, Skepticism and Spaceships…: Reusable content in Paragraphs

Reusable content in Paragraphs
Unifex
Fri, 10/30/2020 – 08:42

While it’s not possible to reuse paragraphs you can create a paragraph type that mimics this behaviour.

Prep reusable content.

  1. Create your various Custom Block Types at Administration > Structure > Block layout > Custom block library. This should already have a Basic block.
  2. Create your reusable content using these block types at Administration > Structure > Block layout. Click Add custom block, select the Block type you want, fill in the content for it.

Add a Block Paragraph Type.

  1. Administration > Structure > Paragraphs types > Add Paragraph type.
  2. Add a Reference > Other field.
  3. For the Type of item to reference select Custom block
  4. Under Reference Type your Custom block types will appear. Select those you want available.

Prep Content Types: Any content types that already have a Paragraphs based field will need to have that field edited and your new Block paragraph type included.

And your done. Your reusable content is now available for selection as an embeddable Paragraph type.

As I was writing this up I was testing it on a project I’m working on to a) ensure it worked and b) I got the steps right. It’s very likely that this will end up in that project.