2 * Implements hook_entity_bundle_field_info().
4 function {{ machine_name }}_entity_bundle_field_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {
5 // Add a property only to nodes of the 'article' bundle.
6 if ($entity_type->id() == 'node' && $bundle == 'article') {
8 $fields['mymodule_text_more'] = BaseFieldDefinition::create('string')
9 ->setLabel(t('More text'))
11 ->setClass('\Drupal\mymodule\EntityComputedMoreText');