Hi, I have a custom config entity form.
In that, I am adding a reference to block by inline entity form.
I would love to show the complex version of the widget for users.
$form[$block_data['block_name']] = [
'#type' => 'inline_entity_form',
'#title' => $this->t($block_data['title']),
'#entity_type' => 'block_content',
'#bundle' => $block_data['bundle'],
'#form_mode' => 'default',
'#default_value' => $block_data['block'],
'#save_entity' => true
];
Is there any way how to do it? If so, can anybody please just point me in the right direction? :)
I already tried a lot of ideas, but nothing works for me.
Thank you
Comments
Comment #2
mortona2k commented#type => inline_entity_form refers to the InlineEntityForm render element.
InlineEntityFormSimple and InlineEntityFormComplex are field widgets, so only applicable to content entity fields.
I don't see a way to use them in a config form unfortunately. The render element works, but you have to write your own code to switch between new and existing entities, and add additional items.
Comment #3
bramdriesen+1 for this! It would be a huge added value if you can set the form display settings for a field which you can add using the render array.
Comment #4
bramdriesenComment #5
marelpup commentedHi , i think there is already an issue open on :
https://www.drupal.org/project/inline_entity_form/issues/2581223#comment...