function aggregator_display_configurable_test_entity_base_field_info_alter
Same name in other branches
- 9 core/modules/aggregator/tests/modules/aggregator_display_configurable_test/aggregator_display_configurable_test.module \aggregator_display_configurable_test_entity_base_field_info_alter()
Implements hook_entity_base_field_info_alter().
File
-
core/
modules/ aggregator/ tests/ modules/ aggregator_display_configurable_test/ aggregator_display_configurable_test.module, line 14
Code
function aggregator_display_configurable_test_entity_base_field_info_alter(&$base_field_definitions, EntityTypeInterface $entity_type) {
/** @var \Drupal\Core\Field\BaseFieldDefinition[] $base_field_definitions */
if ($entity_type->id() === 'aggregator_feed') {
$base_field_definitions['title']->setDisplayConfigurable('view', TRUE);
$base_field_definitions['description']->setDisplayConfigurable('view', TRUE);
$base_field_definitions['image']->setDisplayConfigurable('view', TRUE);
}
if ($entity_type->id() === 'aggregator_item') {
$base_field_definitions['title']->setDisplayConfigurable('view', TRUE);
$options = [
'type' => 'text_default',
'label' => 'above',
];
$base_field_definitions['title']->setDisplayOptions('view', $options);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.