Skip to content

Commit d5dec83

Browse files
authored
trying to affect user cache in another way (#6)
1 parent edac046 commit d5dec83

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

asu_header.module

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,10 @@ function asu_header_preprocess_menu(&$variables) {
166166
// $variables['site_slogan'] = $config->get('slogan');
167167
//
168168
//}
169+
170+
171+
function asu_header_block_build_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) {
172+
if ($block->getPluginId() === "system_menu_block:asu_global") {
173+
$build['#cache']['contexts'][] = 'user';
174+
}
175+
}

0 commit comments

Comments
 (0)