Skip to content
Snippets Groups Projects
Commit 57b4ec19 authored by Ivica Puljic's avatar Ivica Puljic Committed by Ivica Puljic
Browse files

Issue #3378150 by pivica: Some menu blocks can not be loaded by id

parent 49426a64
No related branches found
No related tags found
No related merge requests found
......@@ -349,10 +349,12 @@ function bs_bootstrap_preprocess_breadcrumb(&$variables) {
function bs_bootstrap_preprocess_block(&$variables) {
switch ($variables['base_plugin_id']) {
case 'system_menu_block':
// Check that the block has a menu and it is enabled in theme settings.
// Check that the block has a menu, and it is enabled in theme settings.
if (isset($variables['content']['#menu_name']) && !empty($variables['elements']['#id'])) {
$block = Block::load($variables['elements']['#id']);
if ($block->getRegion() == 'navbar') {
// Some blocks have overriden id, like for example tb_megamenu. If we
// can not load the block we will skip it for now.
if ($block && $block->getRegion() == 'navbar') {
$variables['content']['#theme'] = 'menu__navbar';
// On hover support only for second level horizontal navbar type for
// now.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment