Skip to content

Instantly share code, notes, and snippets.

View himerus's full-sized avatar
🖥️
Creating big things with sharp tools...

Jake Strawn himerus

🖥️
Creating big things with sharp tools...
View GitHub Profile
@himerus
himerus / Blocks.md
Created May 14, 2020 14:38 — 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');