function path_entity_base_field_info_alter

Same name in other branches
  1. 9 core/modules/path/path.module \path_entity_base_field_info_alter()
  2. 8.9.x core/modules/path/path.module \path_entity_base_field_info_alter()
  3. 10 core/modules/path/path.module \path_entity_base_field_info_alter()

Implements hook_entity_base_field_info_alter().

File

core/modules/path/path.module, line 68

Code

function path_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) {
    
    /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */
    if ($entity_type->id() === 'path_alias') {
        $fields['langcode']->setDisplayOptions('form', [
            'type' => 'language_select',
            'weight' => 0,
            'settings' => [
                'include_locked' => FALSE,
            ],
        ]);
        $fields['path']->setDisplayOptions('form', [
            'type' => 'string_textfield',
            'weight' => 5,
            'settings' => [
                'size' => 45,
            ],
        ]);
        $fields['alias']->setDisplayOptions('form', [
            'type' => 'string_textfield',
            'weight' => 10,
            'settings' => [
                'size' => 45,
            ],
        ]);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.