inline_entity_form_preset is a Drupal 8 module that allows adding existing references from a preset entity into an inline entity form widget.
- You have an entity type
Notificationwith a reference fieldUserswhich is intended to send notifications to selected users. - Almost every
Notificationshould be sent to the management team (5 users). - You are tired of selecting at least 5 users from the management team in an
Inline entity formwidget every time you create a notification. - You want to click
Add existing from a preset, select a notification entity calledNotification to the management team (preset), clickAddand have references to 5 user entities from the preset copied over to theInline entity formwidget. - Additionally, if the notification is related to a design topic, you might also want to add 3 users from the design team by clicking on
Add existing from a preset, select a notification entity calledNotification to the design team (preset), clickAddand have references to 3 user entities from the preset added to theInline entity formwidget.
Assuming that you have installed Inline Entity Form module and selected Inline Entity Form - Complex widget for an entity reference field:
- Install
Inline Entity Form Presetmodule. - On the form display management page of a selected entity type click on the cog next to the entity reference field to configure the
Inline Entity Form - Complexwidget. - Check
Allow users to add existing references from a presetand save the settings. - Create a entity of selected entity type which will be the preset and add entity references to it.
- Create or edit an entity of selected entity type, click on
Add existing from a presetin the inline entity form widget, type the name of the preset entity and clickAddto copy the entity references.
Note:
- Entity references from the preset will be appended to the current list of entity references.
- Entity references can only be copied from a preset entity which is of the same entity type and bundle.
- Entity references are copied from the same field which has the
Allow users to add existing references from a presetsetting enabled on the widget.