class EntityViewMode
Same name in this branch
- 8.9.x core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
Same name in other branches
- 9 core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
- 9 core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php \Drupal\Core\Entity\Entity\EntityViewMode
- 10 core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
- 10 core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php \Drupal\Core\Entity\Entity\EntityViewMode
- 11.x core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php \Drupal\migrate\Plugin\migrate\destination\EntityViewMode
- 11.x core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php \Drupal\Core\Entity\Entity\EntityViewMode
Defines the entity view mode configuration entity class.
View modes let entities be displayed differently depending on the context. For instance, a node can be displayed differently on its own page ('full' mode), on the home page or taxonomy listings ('teaser' mode), or in an RSS feed ('rss' mode). Modules taking part in the display of the entity (notably the Field API) can adjust their behavior depending on the requested view mode. An additional 'default' view mode is available for all entity types. This view mode is not intended for actual entity display, but holds default display settings. For each available view mode, administrators can configure whether it should use its own set of field display settings, or just replicate the settings of the 'default' view mode, thus reducing the amount of display configurations to keep track of.
Plugin annotation
@ConfigEntityType(
id = "entity_view_mode",
label = @Translation("View mode"),
entity_keys = {
"id" = "id",
"label" = "label"
},
config_export = {
"id",
"label",
"targetEntityType",
"cache",
}
)
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements \Drupal\Core\Entity\EntityInterface uses \Drupal\Core\Cache\RefinableCacheableDependencyTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Core\Config\Entity\ConfigEntityBase extends \Drupal\Core\Entity\EntityBase implements \Drupal\Core\Config\Entity\ConfigEntityInterface uses \Drupal\Core\Plugin\PluginDependencyTrait, \Drupal\Core\Entity\SynchronizableEntityTrait
- class \Drupal\Core\Entity\EntityDisplayModeBase extends \Drupal\Core\Config\Entity\ConfigEntityBase implements \Drupal\Core\Entity\EntityDisplayModeInterface
- class \Drupal\Core\Entity\Entity\EntityViewMode extends \Drupal\Core\Entity\EntityDisplayModeBase implements \Drupal\Core\Entity\EntityViewModeInterface
- class \Drupal\Core\Entity\EntityDisplayModeBase extends \Drupal\Core\Config\Entity\ConfigEntityBase implements \Drupal\Core\Entity\EntityDisplayModeInterface
- class \Drupal\Core\Config\Entity\ConfigEntityBase extends \Drupal\Core\Entity\EntityBase implements \Drupal\Core\Config\Entity\ConfigEntityInterface uses \Drupal\Core\Plugin\PluginDependencyTrait, \Drupal\Core\Entity\SynchronizableEntityTrait
Expanded class hierarchy of EntityViewMode
See also
\Drupal\Core\Entity\EntityManagerInterface::getAllViewModes()
\Drupal\Core\Entity\EntityManagerInterface::getViewModes()
hook_entity_view_mode_info_alter()
19 files declare their use of EntityViewMode
- CKEditorIntegrationTest.php in core/
modules/ media/ tests/ src/ FunctionalJavascript/ CKEditorIntegrationTest.php - comment.module in core/
modules/ comment/ comment.module - Enables users to comment on published content.
- CommentIntegrationTest.php in core/
modules/ comment/ tests/ src/ Kernel/ CommentIntegrationTest.php - CommentInterfaceTest.php in core/
modules/ comment/ tests/ src/ Functional/ CommentInterfaceTest.php - DisplayApiTest.php in core/
modules/ field/ tests/ src/ Kernel/ DisplayApiTest.php
File
-
core/
lib/ Drupal/ Core/ Entity/ Entity/ EntityViewMode.php, line 42
Namespace
Drupal\Core\Entity\EntityView source
class EntityViewMode extends EntityDisplayModeBase implements EntityViewModeInterface {
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.