Skip to content

Build inline entity form

Available since: 1.0.0

Provided tokens

Token Description
[form] The current form.
Alias: current_form
[form:id] The form ID.
[form:base_id] The form base ID.
[form:operation] The form operation.
[form:mode] The form mode.
[form:triggered] The form field name that triggered the form event.
[form:values]
[form:values:FIELD_NAME] The field value for each of the named fields.
[form:num_errors] The number of form errors.
[entity] The form entity.
[ENTITY_TYPE] The form entity with the token name being the ID of the entity type.
[parent] The parent entity, if one exists.
[event] The event.
[event:delta] The delta of the entity reference in the parent field.
[event:entity] The form entity.
[event:entity_bundle] The bundle of the form entity.
[event:entity_id] The form entity ID, only available if the entity is not new.
[event:entity_type] The form entity type.
[event:field_name] The name of the field.
[event:parent] The parent entity, if one exists.
[event:parent_bundle] The bundle of the parent entity, if one exists.
[event:parent_id] The ID of the parent entity, if one exists and it is not new.
[event:parent_type] The type of the parent entity, if one exists
[event:widget] The form widget ID.
[event] The event.
[event:machine_name] The machine name of the ECA event.
[session_user] The user account that dispatched the event, regardless if ECA is processing models under a different account. This is only available if ECA is configured to always run under a specific account.
[entity] The entity of the event.
[ENTITY_TYPE] The entity of the event under the name of its entity type.

Fires when an inline entity form is being built, either through the Inline Entity Form (IEF) module or the Paragraphs module. The form reference in this event is the subform (the inline entity's form), not the parent form.

Tip

The [event:entity] token holds the inline entity (e.g., a paragraph or media item), while [event:parent] holds the parent entity (e.g., the node). Additional tokens include [event:field_name], [event:delta], and [event:widget].

Fields

Parent: Restrict by form ID

The form ID can be mostly found in the HTML <form> element as "id" attribute.

Comma-separated list of parent form IDs to match. Matches the form that contains the inline entity form, not the inline entity form itself. You can use either the HTML form ID (with hyphens) or the Drupal machine name (with underscores).

Restrict by entity type ID

Example: media, paragraph, storage

Only fires for entity forms. Restricts to the specified entity type (e.g., node, taxonomy_term, user).

Tip

When left empty along with bundle and operation, the event also fires for non-entity forms.

Restrict by entity bundle

Only applies to entity forms. Restricts to the specified bundle (e.g., article, tags). Comma-separated for multiple values.

Parent: Restrict by operation

Example: default, save, delete

Only applies to entity forms. Restricts to the specified form operation (e.g., default, edit, delete). Comma-separated for multiple values.

Parent: Restrict by entity type ID

Example: node, taxonomy_term, user

Restricts to the specified parent entity type (e.g., node). Comma-separated for multiple values.

Parent: Restrict by entity bundle

Example: article, tags

Restricts to the specified parent entity bundle (e.g., article). Comma-separated for multiple values.

Parent: Restrict by field name

Example: field_paragraphs

The field name on the parent entity that renders this inline entity form (e.g., field_paragraphs). Comma-separated for multiple values.