|
|
|
@ -153,9 +153,9 @@ class TwigTweakExtension extends AbstractExtension { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static function drupalBlockById($id, array $configuration = [], bool $wrapper = TRUE) { |
|
|
|
public static function drupalBlockById($id, array $configuration = [], bool $wrapper = TRUE) { |
|
|
|
$storage = \Drupal::entityTypeManager()->getStorage('block'); |
|
|
|
$storage = \Drupal::entityTypeManager()->getStorage('block'); |
|
|
|
$plugin_id = $storage->load($id)->toArray()['plugin']; |
|
|
|
$block = $storage->load($id)->toArray(); |
|
|
|
$configuration['id'] = $id; |
|
|
|
$configuration = array_merge($block['settings'], $configuration); |
|
|
|
return \Drupal::service('twig_tweak.block_view_builder')->build($plugin_id, $configuration, $wrapper); |
|
|
|
return \Drupal::service('twig_tweak.block_view_builder')->build($block['plugin'], $configuration, $wrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|