outline-8.x-1.x-dev/tests/modules/outline_entry_display_configurable_test/outline_term_display_configurable_test.module

tests/modules/outline_entry_display_configurable_test/outline_term_display_configurable_test.module
<?php

/**
 * @file
 * A module for testing making outline_entry base fields' displays
 * configurable.
 */

use Drupal\Core\Entity\EntityTypeInterface;

/**
 * Implements hook_entity_base_field_info_alter().
 *
 * @param $base_field_definitions
 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
 */
function outline_entry_display_configurable_test_entity_base_field_info_alter(&$base_field_definitions, EntityTypeInterface $entity_type) {
  if ($entity_type->id() === 'outline_entry') {
    /** @var \Drupal\Core\Field\BaseFieldDefinition[] $base_field_definitions */
    $base_field_definitions['name']->setDisplayConfigurable('view', TRUE);
  }
}

/**
 * Implements hook_entity_type_build().
 */
function outline_entry_display_configurable_test_entity_type_build(array &$entity_types) {
  // Allow skipping of extra preprocessing for configurable display.
  $entity_types['outline_entry']->set('enable_base_field_custom_preprocess_skipping', TRUE);
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc