Each day, between migrations and new projects, more and more features are becoming available for Drupal 8, the Drupal community's latest major release. In this series, the Acquia Developer Center is profiling some prominent, useful, and interesting projects--modules, themes, distros, and more--available for Drupal 8. This week: Inline Entity Form.
The Drupal 8 port of Inline Entity Form was started by Florian Weber (webflo) in January 2014. His work was continued by Janez Urevc (slashrsm) roughly a year later. The big, final round of round of porting efforts happened in February 2016, when Ted Bowman (tedbow), Bojan ŽivanoviÄ (bojanz) and Janez Urevc collaborated, spending more than 3 months of developer time bringing the port to its first Drupal 8 beta release.
Their work was sponsored by Ueberbit, Examiner.com, Commerce Guys, and Acquia's D8 Module Acceleration Program. Many hours of volunteer work were contributed over and above the sponsored time. Thank you!
I spoke with Bojan ŽivanoviÄ and Janez Urevc about the module and the porting process. Bojan works for Commerce Guys as the development lead for Commerce 2.x. He has been working with Drupal since 2007 and has left his mark on Views, Views Bulk Operations, Inline Entity Form, and many Drupal Commerce contributed modules. Janez Urevc was one of the initial founders and leads of the Drupal 8 media initiative and is a senior engineer and team lead at Zürich-based MD Systems--themselves heavy contributors to Drupal 8.
Inline Entity Form (aka 'IEF') extends the functionality of entity reference fields in Drupal, to allow referenced entities to be created, edited, deleted on the fly. Changes to the referenced entities are only saved when the main form is saved.
Though the problem space sounded a little dry and abstract to me at first, understanding it also helped me understand why IEF is installed on roughly 68,000 Drupal sites. :-)
This is a solution to Drupal's UX being 'inside out' for some purposes. Doing things the 'traditional Drupal way,' if a node needs to reference another entity or category, that needs to be created first. This can be frustrating, since it feels like one has to start from the end and work towards the beginning. IEF can reduce frustration by providing a more intuitive UX.
eCommerce listings are a good example. In shopping catalogs, it's common for a Product ('My T-Shirt') to have a set of varying Attributes (size and color in this case). Each combination of Product Attribute values is called a Product Variation (red/small, blue/small, green/medium, etc.). Each Product Variation has a price and a SKU ('Stock Keeping Unit', a unique ID code).
Drupal Commerce 1.x followed the unintuitive 'Drupal way' pattern: To make a t-shirt product listing with all available options, you had to an entity for each SKU (in our case: red/small, blue/small, green/medium, etc.) first before you could create the t-shirt catalog form. Once you had created all the necessary SKU's, you could then reference those entities manually on the parent form. Bojan admits, 'Naturally, people were not happy about using two different UIs to accomplish what was essentially a single operation.'
Now, using IEF, you can create, edit, and delete the relevant entities directly in the parent form (or even refer to existing ones if you already have them in your catalog). In our eCommerce example, I can create the main t-shirt form I need, add all of my SKU variations to it, and save it--all in the same UI.
Modeling this sort of data and relationships is one of Drupal's strengths. Bojan gets to the heart of the matter, 'Data models are full of 1:n relationships ('order has multiple line items', 'page has multiple paragraphs'). Implementing this in Drupal without IEF is a challenge. IEF is important because it allows proper data models to be implemented without sacrificing UX for the site's administrative end users. The entities are also aware of the fact that they are embedded, via parents, same way the field widgets are. This allows them to be nested as many times as needed.'
Inline Entity Form provides two widgets for administrative users, the 'simple' widget and the 'complex' widget.
The simple widget shows a row for each reference, with the entity form inside. This is the 'field collection' UX.
The complex widget shows a table with a row per reference, with edit/delete links that open the edit form / delete confirmation form in the row underneath it. It can also have additional available operations like referencing existing entities.
'Bojhan Somers (the UX lead for Drupal 7) designed the current complex widget, modeling it after the formatter settings form (where the formatter settings get loaded underneath the formatter itself). Ryan Szrama used that mockup to create a sandbox module called 'Inline Product Form'. Once we started Commerce Kickstart v2, I picked up that code and rewrote it to make the entity form handling pluggable, separating the Commerce-specific parts. Inline Entity Form was born!' continues Bojan, 'The key difference between Inline Entity Form and other solutions is keep the inline changes (created/updated/deleted entities) in one place and then save them only when the parent form is saved. This pattern matches users' expectations about such forms, rather than trying to bend them to our 'perfectly logical' but counterintuitive Drupal data-modeling concepts.'
Bojan summarized one of the big challenges they faced and gave me three examples of how IEF has changed in Drupal 8:
Janez picked up here, 'The biggest change that we needed to adapt to was entity validation. In Drupal 7 we relied on form validation, while now we needed to build and validate the entities themselves. As with other complex Drupal modules, porting IEF to Drupal 8 took a long time due to three primary factors:
'Inline Entity Form is a great example of community collaboration,' Janez explains, 'Something that was born to solve problems in eCommerce was made broadly useful thanks to visionary planning and good software design. This is why the module got on our radar in the Media Initiative, which resulted in more resources being dedicated to it and a more sustainable development process. Many other parts of the community have identified Inline Entity Form as something that might be useful to them. This could result even more exciting use-cases and a bright future for the module.'
'IEF is also a taste of how the future of the Drupal contributed module space might look. Instead of having a lot of narrow-scoped modules that do one little thing in an idiomatic, non-collaborative way, I'm hoping we'll see more and more generalist modules sharing the standard tools that Drupal 8's core offers (entities, fields, etc.) to solve similar problems in different areas.'
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Fri Sep 12 2025 06:02:25 GMT+0000 (Coordinated Universal Time)