Conditionally make block available for specific modules only?

Looking to make a block specifically only available for a given module.
1 Reply
pauldwight
pauldwight2mo ago
Hi @Braunson you can use the following to include/exclude any blocks you want
// Exclude specific blocks
$form->add(
BlockEditor::make()->excludeBlocks(['block_1', 'block_2']),
);

$form->add(
BlockEditor:make()->includeBlocks(['block_1', 'block_2']);
);
// Exclude specific blocks
$form->add(
BlockEditor::make()->excludeBlocks(['block_1', 'block_2']),
);

$form->add(
BlockEditor:make()->includeBlocks(['block_1', 'block_2']);
);

Did you find this page helpful?