5

Paragraph items are only available to their parent entities. But is there any known way to make it possible to re-use existing Paragraph items?

11

Paragraphs is focused on reusing layouts not content. The most obvious implication is on revisions.

In a standard reference field you reference the latest revision of the target. When you roll back the parent the target keeps the actual content. Paragraphs on the other hand keeps track of the revisions and allows you to rollback an entity including the content of the paragraphs that are owned by the entity. And that's the problem, if Paragraphs would allow reusing, how a rollback should be handled for paragraphs that are shared among multiple host entities.

So Paragraphs is by design not a tool for reusing content.

But there is good news, there will be a library entity, which will make this possible:

Implement Library entity type

We want to make this separate entity type: - Autosync with bundles + fields of Paragraphs - Still add a label (plus more administrational fields if needed for managing them).

A reusable paragraph will be typically stored as a clone of a previous paragraph. It is NOT a composite of the original. Reusable paragraphs have an own separate edit form and can also be creted independently through the Add form.

A user can click the action "Add to library" that makes a paragraph reusable. This clones the paragraph and the original host entity will have a new paragraph instance added that contains a reference to the effective reusable paragraph.

The paragraph type "From Library" contains nothing but a entity reference to the reusable paragraph. Initially, using autocomplete widget here is fine.

https://www.drupal.org/node/2843917

  • 2
    And just to add an alternative—you can use Entity Construction Kit + Inline Entity Form to get a setup very much like Paragraphs, but with first-class entities that can be reused more easily (at least at the time of this writing). – geerlingguy Feb 13 '17 at 21:49
  • Yes, this is what I meant by using standard reference fields. I would prefer at the moment a custom entity build with Drupal Console, until there is a stable release of ECK or Paragraphs Collection. – 4k4 Feb 15 '17 at 7:38
  • We've overcome this issue by combining paragraphs and blocks. For each paragraph type, also create a block type with a single entity reference field to that particular paragraphs type and a cardinality of 1. Each of these blocks is reusable. Works great in panels! – Beau Nov 23 at 2:42

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.