Fragments
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
Fragments are re-usable bits of content. Fragments are similar to Paragraphs, but where Paragraphs are bound to their host entity (and revisioned along with it), Fragments are meant to be re-used and potentially update the same bit of content across many pages. Fragments are fieldable and revisionable.
Required modules
Entity API
As most entity-heavy modules.
Administration Views
Fragments' admin screen uses this module.
Views Bulk Operations
Fragments' admin screen uses this module.
X Autoload
The module relies on this module to include its classes in a Drupal 8-like way.
Entity Reference
Although not technically a requirement (i.e. your site will not break if you install Fragments without Entity Reference), this Fragments's use is extremely limited without it. Entity Reference is the basic method with which you associate Fragments to e.g. nodes in order to display them on a page for end users. With that said, please report any other uses you might find for Fragments that do not require Entity Reference (if that sounds like a challenge, it is).
Recommended modules
Several modules go together particularly well with Fragments, depending on your use-case.
Inline Entity Form
Inline Entity Form offers a entity reference widget that will display a form to create a new Fragment inline in e.g. the node form where you reference Fragments. In certain uses cases you may want to enforce the need to create a Fragment separately, but in many cases it is extremely conventient to be able to create a new Fragment on the fly, right where you need it.
Automatic Entity Label
Every Fragment needs a label to identify it in the interface, but in many cases you do not want to tie this to a title displayed to users (i.e. two Fragments may need the same title on your site's frontend, but editors still need a way to distinguish them). So, you end up adding a Display Title field. This module will help to set things up so editorial users only need to fill in the display title in most cases, but still have the option to override the administrative label when needed.
Entity View Modes
Fragments have a single view mode, full. In many cases, that's all you'll need, but if you need to display the same Fragment type in different ways, this module will allow you to create additional View Modes.
