How to Create, Edit, and Select Referenced Entities Inline in Drupal Using the Inline Entity Form Module

If your Drupal site has content types linked through entity reference fields — for example, a “Student” content type that references a “Location” content type — you already know the default editing experience isn’t great. This article walks through the Inline Entity Form module, why it matters, and exactly how to set it up.

In this article

  • The problem content editors face when working with reference fields without Inline Entity Form
  • What the Inline Entity Form module is and how it solves the problem
  • How to install and configure the module step by step
  • How to let editors add a new referenced node or select an existing one, inline
  • How to customize which fields appear inside the inline form using custom form modes
  • Recommended enhancements and best practices for a smoother editing experience

The Problem: Editing Reference Fields Without Inline Entity Form

Out of the box, Drupal’s entity reference field only lets an editor pick from content that already exists. If the related content doesn’t exist yet, the editor is stuck. This creates several real, day-to-day problems for content teams:

  • Workflow interruption: To create a Student node that references a Location, the editor first has to stop, leave the Student form entirely, go create the Location node separately, and then come back to search for and select it.
  • Risk of losing unsaved work: Navigating away from a partially filled form to create the referenced content can mean losing everything already entered on the original form, especially if the editor forgets to save a draft first.
  • More clicks, more time: What should be a single task — “create a student and its location” — becomes two separate, disconnected tasks, which slows down content creation, especially for editors managing high volumes of content.
  • Duplicate content: Because editors can’t easily see or search existing referenced entities while filling out the main form, it’s easy to accidentally create a duplicate Location node instead of reusing one that already exists.
  • No inline editing of existing references: Even when the correct Location node already exists, there’s no way to tweak or correct its details from within the Student form — editors have to open it separately.
  • Harder for non-technical editors: Jumping between content types and remembering to return to the original form assumes a level of familiarity with the site structure that many content editors simply don’t have.
  • Gets worse with multi-value fields: If a field can reference multiple entities, this back-and-forth has to be repeated for every single value, compounding the problem.

These issues add friction to everyday publishing work and increase the chance of mistakes — which is exactly the gap the Inline Entity Form module closes.

The Solution: Inline Entity Form

Inline Entity Form lets you embed the add/edit form of a referenced content type directly inside the form of the content type that references it. Instead of leaving the Student form to create a Location, the editor can create (or select) the Location node right there, inline, and continue exactly where they left off.

Installing the Module

Download and enable Inline Entity Form from the official project page:

https://www.drupal.org/project/inline_entity_form

For this walkthrough, we’ll assume you already have a “Student” content type with a reference field pointing to a “Location” content type.

Step-by-Step Configuration

Step 1: Confirm the reference field setup

On the Student content type, make sure the reference field is in place. Here, “Location from” is the field that references the Location content type.

The Location content type itself just needs its own regular fields — nothing special is required on this side yet.

Step 2: Set the widget on Manage Form Display

Go to the Student content type’s “Manage Form Display” page. In the widget column for the “Location from” field, change the widget to “Inline Entity Form — Complex.”

Step 3: Configure the widget settings

Click the settings (gear) icon in the same row and enable:

  • Collapsible — keeps the inline form tidy by collapsing it into a summary once filled in
  • Allow users to add new nodes — lets editors create a brand-new Location from within the Student form
  • Allow users to add existing nodes — lets editors search for and attach an existing Location instead of creating a duplicate

Step 4: See it in action on the Student add-node form

Open the “Add Student” form. You’ll now see options to add a new Location node or add an existing one, without leaving the page.

Choosing “Add new node” opens the Location creation form inline, right inside the Student form:

Choosing to add an existing node instead opens a search box so the editor can find and reuse a Location that’s already been created — which is what avoids duplicate content:

Once added, the referenced Location node(s) appear directly within the Student add-node form:

Customizing Which Fields Appear in the Inline Form

By default, the inline form shows every field on the referenced content type, which can be more than an editor needs (or should be allowed to touch) while filling out the parent form. You can trim this down using a custom form mode.

Step 1: Create a custom form mode

Go to Structure → Display modes → Form modes and create a new form mode — for example, “Inline Entity Form” — scoped to the Location content type.

Step 2: Enable the form mode on the Location content type

Go to “Manage Form Display” for the Location content type, and enable the new form mode.

After saving, a new tab for “Inline Entity Form” appears on this page.

Step 3: Disable the fields you don’t need inline

On the new “Inline Entity Form” tab, move any fields that aren’t needed in the inline context down into the Disabled section.

Now the Student add-node form only shows the essential Location fields inline, keeping the form focused and quick to fill out:

Limiting the inline form to a handful of essential fields also makes it easier and safer for editors to go back and complete the rest of the referenced node’s details later, from its own edit page.

Recommended Enhancements

A few things worth considering once the basic setup above is working, to make the experience more robust for your editorial team:

  • Field-level permissions: Pair Inline Entity Form with a permissions module so editors only see and edit the referenced fields they’re actually allowed to touch.
  • Choose the right widget variant: Use “Inline Entity Form – Simple” for single-value, single-bundle references, and reserve “Complex” for fields that can reference multiple entities or bundles — Simple keeps the UI lighter where Complex isn’t needed.
  • Reduce duplicate content further: Combine the “add existing node” search with clear, descriptive titles on the referenced content type (e.g. Location names that include city or campus) so editors can tell existing entities apart at a glance.
  • Surface validation clearly: Make sure required-field and validation errors on the inline form are visually obvious — they can be easy to miss inside a collapsed or nested fieldset.
  • Watch performance on large datasets: If the referenced content type has thousands of nodes, make sure the “add existing node” autocomplete is backed by a properly indexed search (e.g. Search API) so it stays fast.
  • Label collapsible sections clearly: Customize the summary label shown when a section is collapsed, so editors can tell at a glance which referenced item is which without expanding each one.
  • Check accessibility and mobile behavior: Collapsible inline fieldsets should still be usable with a keyboard and on smaller screens — worth a quick manual check after configuration.
  • Document the workflow internally: A short internal guide on when to “add new” versus “add existing” helps keep the editorial team consistent and further reduces accidental duplicates.

Conclusion

Without Inline Entity Form, editors are forced to juggle multiple forms and tabs just to create simple, related content — which slows them down and invites duplicate entries. By embedding the referenced content type’s form directly inside the parent form, and trimming it down to only the fields that matter with a custom form mode, you get a faster, cleaner, and far less error-prone editing experience.


Get Free E-book
Get a free Ebook on Drupal 8 -theme tutorial
I agree to have my personal information transfered to MailChimp ( more information )

You may also like...