Adding Fields to Inline Entity Form Table

Inline Entity Form is a useful module for reference entities and being able to edit them in place.

Here’s what the edit form looks like out of the box for an unlimited value entity reference:

Default output

Often it’s helpful to provide additional information to your editors.

If you have a look at inline_entity_form.module you will find a function called theme_inline_entity_form_entity_table(). Within this you will see how this table is built, and how you can manipulate the form to add additional columns of information.

Here’s an example (mymodule.module) showing how I am able to add two additional fields to the table:

  • sow = top level content type
  • field_sow_er_lis = entity reference field in sow content type that references sowli nodes
  • sowli = content type being referenced
  • field_sowli_timeline = term reference field in sowli content type
  • field_sowli_timeline = term reference field in sowli content type
Here’s the result:

With extra columns

Tagged with: , ,
Posted in Development

Leave a Reply

Your email address will not be published. Required fields are marked *

*