Skip to content

How to render entity reference field in forms? #7

Description

@mkinnan

I'm trying to create my own node/add forms. How do I render an entity reference field that is referencing a vocabulary of taxonomy terms?

form.elements['field_data_field_group_location'] = {
  type: 'entityreference',
  title: t('Group Location Tags'),
  required: true,
  default_value: node.field_data_field_group_location
};

I've tried different type:

  • entityreference_autocomplete
  • entityreference
  • entityreference_form_element
  • entityreference_autocomplete_tags
  • autocomplete

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions