How can I get the current region ID inside hook_preprocess_block()
?
I tried the following code, but it seems something is wrong.
function ThemeName_preprocess_block(&$variables) {
if ($variables['elements']['#region'] == "nav") {
$variables['attributes']['class'][] = 'SomeStyle';
}
}
$region = $variables['elements']['#configuration']['region'];