Skip to content
Snippets Groups Projects
Commit 01c06367 authored by Damien McKenna's avatar Damien McKenna Committed by Benjamin Melançon
Browse files

Issue #3243842 by DamienMcKenna, naresh_bavaskar, mlncn: Block template suggestion per bundle

parent 414700f2
Branches
Tags
No related merge requests found
......@@ -25,6 +25,9 @@ function twigsuggest_theme_suggestions_block(array $variables) {
if (isset($variables['elements']['#id']) || !empty($variables['elements']['#id'])) {
if ($block = Block::load($variables['elements']['#id'])) {
if (isset($variables['elements']['content']['#block_content'])) {
$suggestions[] = 'block__bundle__' . $variables['elements']['content']['#block_content']->bundle();
}
$suggestions[] = 'block__' . $block->getRegion();
$suggestions[] = 'block__' . $block->getRegion() . '__' . $variables['elements']['#id'];
if ($block->get('settings') && $provider = $block->get('settings')['provider']) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment