Hello,

I installed the module and added some classes in some blocks. The problem is that I need to load this blocks in various node types (programatically) and unset the classes that I configured for this blocks.

In my theme.theme file I used this code:

//Get people block
$block_pople = Block::load('personas');
$block_pople->unsetThirdPartySetting('block_class', 'classes');

$block_people_content = \Drupal::entityTypeManager() ->getViewBuilder('block') ->view($block_pople);

$variables['people_block'] = $block_people_content;

If I debug the result of the $block_pople, I see that the classes are removed well, but when I render the block in the node, the classes are present. I'm doing something wrong?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

originalcode created an issue. See original summary.

AstonVictor’s picture

FileSize
2.29 KB
26.85 KB

Hi there!
I added a patch that added new config field 'Disable css class(es) on pages'.
Please, check it.

berenddeboer’s picture

Status: Active » Closed (won't fix)

It seems this patch would only address a minority of the very specific use cases imaginable. So probably more something that belongs in a a separate module.