I used to the following in a drupal 7 theme.
function mytheme_preprocess_block(&$variables) {
// Add class to block titles.
$variables['title_attributes_array']['class'][] = 'block-title';
if ($variables['block']->region == 'header_top' ||
$variables['block']->region == 'search_box' ||
$variables['block']->region == 'footer') {
$variables['title_attributes_array']['class'][] = 'element-invisible';
}
}
Tried several alternatives including preprocess_layout without any success.
Layouts and themes are different in Backdrop CMS and some of the
$variablesattributes you are looking for are not there; that is why your function is not working. What I suggest is to install the Devel module (if you haven't already) and do the following:This will show you what is available. I think you will be able to do it by comparing the
$variables['block']->uuidto the items in$variables['layout']->positionsand then using that to adjust$variables['block']->settings['title_display']