Created
October 19, 2018 17:30
-
-
Save DanLaufer/f35f6564ce6d091b4117cd116593de8c to your computer and use it in GitHub Desktop.
Drupal 8 - Load Blocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load block and render | |
$socialNetworksBlock = \Drupal\block_content\Entity\BlockContent::load(7); | |
$variables['social_networks'] = \Drupal::entityTypeManager() | |
->getViewBuilder('block_content') | |
->view($socialNetworksBlock); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment