0

I've got a field on a content type that is a taxonomy reference with multiple terms.

I'm trying to pull all this values from my custom module config so I can limit my module only displaying on specific pages of the content type.

$form['field_type'] = [
  '#type' => 'select',
  '#title' => $this->t('Field Types'),
  '#empty_option' => $this->t('-None-'),
  '#options' => $fieldOptions,
  '#default_value' => isset($this->configuration['field_type']) ? $this->configuration['field_type'] : '',
  '#required' => TRUE,
];

Where $fieldOptions would be the multiple terms from this specific field. At the moment i've only been able to get all content types using this method but is this possible for fields?

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.