Extra Block Types (EBT) - New Layout Builder experience❗
Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.
❗Extra Paragraph Types (EPT) - New Paragraphs experience
Extra Paragraph Types (EPT) - analogical paragraph based set of modules.
Content Entity
Menu
- Understanding Drupal
- Drupal System Requirements
- Installing Drupal 8
- Drupal 8 Update
- Drupal Site Administration
- Drupal 8 Modules
- Drupal Modules Comparison
- Drupal Themes
- Drupal field types
- Configuration Management
- Multisite Drupal
- Accessibility Features
- Troubleshooting in Drupal
- Creating modules for Drupal
-
Drupal 8 API
- Authentication API
- Block API
- Cache API
- CKEditor API
- Configuration Management API
- Database API
-
Entity API
- Introduction Entity API in Drupal
- Entity Types
- Working with Entity API
- Configuration Entity
- Content Entity
- Creating Custom Content
- Creating a Custom Content Type in Drupal 8
- Programming Custom Fields into Your Content Type
- Using the UI to Export Code for Custom Fields
- Entity API Implements API Typed Data
- Entity Access (TBD)
- Defining and Using Content Entity Field Definitions
- API Entity Translation
- Display Modes: View and Form Modes
- FieldTypes, FieldWidgets and FieldFormatters
- Overview: Creating a Custom Field
- Theming in Drupal
- Upgrade to Drupal 11
This cheat sheet provides an overview of commonly used methods, classes, and interfaces for content entities.
/sites/default/files/drupal-content-entity-8.0.pdf
Content entities inherit much of their behavior from entities. See Working with the Entity API for those shared features.
Managing Field Values
Create custom fields using the baseFieldDefinitions
method for your content entity.
- Load an instance of your custom entity into a local variable
$Custom_Entity
- Define a custom field named
custom_field
- Store some data
Code Example
$custom_field_value = $Custom_Entity->custom_field->value; // Perform some kind of data manipulation $Custom_Entity->custom_field->value = $custom_field_value; $Custom_Entity->save();
Examples of content entities:
- node
- comment
- user