Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PathHooks.php

function PathHooks::entityBaseFieldInfoAlter

Implements hook_entity_base_field_info_alter().

File

core/modules/path/src/Hook/PathHooks.php, line 83

Class

PathHooks
Hook implementations for path.

Namespace

Drupal\path\Hook

Code

public function entityBaseFieldInfoAlter(&$fields, EntityTypeInterface $entity_type) : void {
    
    /** @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,
            ],
        ]);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal