How to add taxonomy term reference field in a custom form
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
6
down vote
favorite
In the previous version of Drupal, it was possible to reference taxonomy tags in Drupal's forms using the following option:
'#autocomplete_path' => 'taxonomy/autocomplete/'.$vid,
However, in the Drupal 8, taxonomy term reference field has been removed in favor of Entity reference, more info here.
So, is there any alternative available?
8 forms entities
add a comment |Â
up vote
6
down vote
favorite
In the previous version of Drupal, it was possible to reference taxonomy tags in Drupal's forms using the following option:
'#autocomplete_path' => 'taxonomy/autocomplete/'.$vid,
However, in the Drupal 8, taxonomy term reference field has been removed in favor of Entity reference, more info here.
So, is there any alternative available?
8 forms entities
add a comment |Â
up vote
6
down vote
favorite
up vote
6
down vote
favorite
In the previous version of Drupal, it was possible to reference taxonomy tags in Drupal's forms using the following option:
'#autocomplete_path' => 'taxonomy/autocomplete/'.$vid,
However, in the Drupal 8, taxonomy term reference field has been removed in favor of Entity reference, more info here.
So, is there any alternative available?
8 forms entities
In the previous version of Drupal, it was possible to reference taxonomy tags in Drupal's forms using the following option:
'#autocomplete_path' => 'taxonomy/autocomplete/'.$vid,
However, in the Drupal 8, taxonomy term reference field has been removed in favor of Entity reference, more info here.
So, is there any alternative available?
8 forms entities
edited Aug 9 at 17:59
Pierre.Vriens
35k1334154
35k1334154
asked Aug 9 at 13:46
Hedeshy
2169
2169
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
7
down vote
accepted
Well, I have found the way in the change records. take a look at: https://www.drupal.org/node/2418529
Here is the example options for taxonomy fields:
'#type' => 'entity_autocomplete',
'#target_type' => 'taxonomy_term',
'#selection_settings' => [
'target_bundles' => array($vid1, $vid2),
],
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
accepted
Well, I have found the way in the change records. take a look at: https://www.drupal.org/node/2418529
Here is the example options for taxonomy fields:
'#type' => 'entity_autocomplete',
'#target_type' => 'taxonomy_term',
'#selection_settings' => [
'target_bundles' => array($vid1, $vid2),
],
add a comment |Â
up vote
7
down vote
accepted
Well, I have found the way in the change records. take a look at: https://www.drupal.org/node/2418529
Here is the example options for taxonomy fields:
'#type' => 'entity_autocomplete',
'#target_type' => 'taxonomy_term',
'#selection_settings' => [
'target_bundles' => array($vid1, $vid2),
],
add a comment |Â
up vote
7
down vote
accepted
up vote
7
down vote
accepted
Well, I have found the way in the change records. take a look at: https://www.drupal.org/node/2418529
Here is the example options for taxonomy fields:
'#type' => 'entity_autocomplete',
'#target_type' => 'taxonomy_term',
'#selection_settings' => [
'target_bundles' => array($vid1, $vid2),
],
Well, I have found the way in the change records. take a look at: https://www.drupal.org/node/2418529
Here is the example options for taxonomy fields:
'#type' => 'entity_autocomplete',
'#target_type' => 'taxonomy_term',
'#selection_settings' => [
'target_bundles' => array($vid1, $vid2),
],
answered Aug 9 at 14:04
Hedeshy
2169
2169
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdrupal.stackexchange.com%2fquestions%2f267261%2fhow-to-add-taxonomy-term-reference-field-in-a-custom-form%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password