Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By CooleWampe on
I have a few custom vocabulary defiend which have nothing to do with each other (f.e. colors and music). I like to define a field that allows only taxonomy-terms from one vocabulary. I have found lots of equal examples that using all vocabulary, but I didn't found anything for using only a part of the vocabularys.
This is what I found:
$fields['refTaxId'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('custom taxonomy'))
->setDescription(t('Get a value from a custom taxonomy'))
->setSetting('target_type', 'taxonomy_term');
I think i need to something like this:
->setSetting('?????', 'colors')
Any ideas, hints?
thx CW
Comments
solution
After a extensive search (over one week), I've found something like this...
Thx CW