by Jeff Eaton on October 8, 2012 // Short URL

Module Monday: Inline Entity Form

How to Edit and Manage Content With Entity Reference Fields and Nested Relationships

With Drupal's custom content types, custom fields, and the addition of the popular Entity Reference module, site builders can whip up complex content models without a line of code. Editing those complex inter-related content types isn't always easy for content creators, though. The "Create a node, save it, then create its parent, then link the two" workflow is frustrating and error-prone. Fortunately, the Inline Entity Form module can help.

Screenshot of administration screen

Like many of the nifty Drupal tricks these days, Inline Entity Form is a custom field editing widget. On any content type with an Entity Reference field, choose it as the field's editing widget, and the rest is magic. When you create a new piece of content, you'll get the form to create the referenced entity on the same form. It works smoothly with multi-value fields, and can use a simple autocomplete picker to link existing entities if they already exist.

Screenshot of resulting change to site

The challenge of creating and populating complex nested content relationships has always been a tricky one in Drupal. Inline Entity Form was created by the Drupal Commerce team to simplify the management of complex product collections, and it solves the problem quite nicely.

Jeff Eaton

Senior Drupal Architect

Want Jeff Eaton to speak at your event? Contact us with the details and we’ll be in touch soon.

Comments

Add Your Comment

eaton

Good catch!

Most of the models I build tend to involve relationships between different, discrete content types (Artist, Album, Song, and so on). That's a good caveat to keep in mind. Thanks!

Reply

Scott

Check link

Informative, as always. I'm going to give this one a test drive right now.

PS The Entity Reference link above is bork'd.

Reply

e15baer

Would this module apply

Would this module apply where, for example, I have a parent node of content type Event, and I want users to be able to create child nodes of type Submission directly from the Event node's display? Preferably, I want the user to be unable to change which Event their Submission refers to once they begin composing.

Reply

Percept

Field collection?

This seems like the exact same functionality provided by the Field Collection which is a great module. I'll check out Entity Form to see if it's any different/better.

Reply

Valderama

The Field collection module

The Field collection module provides similar functionality - however it's not the _same_.

There, the embedded entity will always be a field collection, while here with this module you can embed any entity - also a term or user for example.

Reply

BetoSoft

Field collection and Inline

Field collection and Inline Entity Form can achieve similar stuff. Sometimes is more appropriate to use a field (field collection) than a node (inline entity). However consider that content translation is available with field collection until now. Reply

jygastaud

Entity Connect

I am the maintainer of Entity Connect which was mentioned in previous comment.
Entity Connect offers a different way to manage references between fields.

Feel free to ask or request anything on project issue queue.

Reply

Julian

Thanks a lot I had some

Thanks a lot I had some issues with inline_entity_form which was caused by errors with entity API. Will give this a try instead. Reply

Add Your Comment