Skip to content

Instantly share code, notes, and snippets.

View sueleybyte's full-sized avatar
🍰
The cake is not a lie!

Süleyman Özdogan sueleybyte

🍰
The cake is not a lie!
View GitHub Profile
@sueleybyte
sueleybyte / Blocks.md
Created May 28, 2020 18:16 — forked from bdlangton/Blocks.md
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');