- Issue created by @mistergroove
How would I be able to use this in code with an entity reference view as the selection settings. I currently have the following that works to select all profile nodes :
$form['profile'] = [
'#type' => 'selectize_entity_autocomplete',
'#target_type' => 'node',
'#title' => $this->t('Profile'),
'#title_display' => 'none',
'#settings' => [
'maxItems' => 1,
'delimiter' => ', ',
'closeAfterSelect' => true,
'plugins' => ['remove_button'],
],
'#selection_settings' => [
'target_bundles' => ['profile']
],
'#required' => TRUE,
];
I want to be able to use an entity reference view instead of getting all profile nodes. I tried this but it doesnt work :
$form['profile'] = [
'#type' => 'selectize_entity_autocomplete',
'#target_type' => 'node',
'#title' => $this->t('Profile'),
'#title_display' => 'none',
'#settings' => [
'maxItems' => 1,
'delimiter' => ', ',
'closeAfterSelect' => true,
'plugins' => ['remove_button'],
],
'#selection_settings' => [
'view' => [
'view_name' => 'profile_reference',
'display_name' => 'enity_reference_profiles',
'arguments' => []
],
'match_operator' => 'CONTAINS'
],
'#required' => TRUE,
];
Any help would be much appreciated.
Active
2.0
Code