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.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll
12/04/2025, by Ivan

This cheat sheet provides an overview of commonly used methods, classes, and interfaces for content entities.

d8-entity-thumb

Download

/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
Source URL:

Drupal’s online documentation is © 2000-2020 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.