I want to create an entity reference field in Drupal 8 using my custom module. Like when someone clicks a link on a Drupal page, an entity reference field would be created in the page node type automatically.
Can anyone help me with this?
drupaldrupal-8
I want to create an entity reference field in Drupal 8 using my custom module. Like when someone clicks a link on a Drupal page, an entity reference field would be created in the page node type automatically.
Can anyone help me with this?
Best Answer
This will create an entity reference field for
node
content types with thearticle
bundle.Note you can change
target_type
for other entities liketaxonomy_term
.