0

I have a content-type A which has a reference field to another content-type B. When creating/editing content with type A I let the user create/edit content of type B using the inline_entity_form module.

In this scenario, I like to pre-populate one field in content-type B. Here I'm using the entityreference_prepopulate module, but when I add the field to my URL its not populated? As example, if the field in B has the name field_myfiled , I write in the URL:

example.com/mypage?field_myfield=value1

This has worked before on fields which are rendered "normally". Is there something I'm missing since the filed is rendered by the inline_entity_form module?

2 Answers 2

0

Please try Entity reference autofill with Entityreference prepopulate Module.

  1. Add an entity reference field in your entityform.
  2. The entity reference autofill will automatically fill reference value into field. We can load default value from URL. (?field_name = value)
  3. Entityreference prepopulate will prepopulate the values. (you have to add existing fields for that.)

Hope this will help you.

1
  • Thanks for the suggestion Abin. These modules has worked for me in the past when I wanted to do similar things. But I can't get them to work when the form is rendered/presented with the inline_entity_form module? Seems to have no effect and neither has the hook_form_alter function?
    – Fever
    Commented Apr 25, 2016 at 17:02
0

These fine gentlemen had the answer I needed. Went with an custom code approach in the end.

form_alter: Inline entity Form

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.