We have a bit of a problem with the HTML block. Our graphic design team does not want different font sizes and colours on the website, but formatted text pasted into the textarea is rendered. Is there an easy solution to this?
To get around the issue, we’ve made a small Markdown module that works fine. I’m now trying to remove the option to include the HTML block in pages. So far I have a work around that works.
You could use your module to just deregister the HTML block so it’s not available anywhere.
You could also probably just make your module’s Markdown block replace the HTML block by giving it the same internal “name” as the existing HTML block when you’re registering it in your module’s config file.
Both of these options will have problems if you have existing pages using the HTML block but should be fine if it’s never used at all.
I can successfully deregister blocks as you suggested
if (isset($config['block_layouts']['invokables']['tableOfContents'])) {
unset($config['block_layouts']['invokables']['tableOfContents']);
}
if (isset($config['block_layouts']['invokables']['browsePreview'])) {
unset($config['block_layouts']['invokables']['browsePreview']);
}
Thanks!
I see the html block is included as a factory, and if I do …
if (isset($config['block_layouts']['factories']['html'])) {
unset($config['block_layouts']['factories']['html']);
}
…the block is not removed but made invalid
Unknown [html] This layout is invalid.
Does that mean that I can only remove blocks that are invokable?
What about other blocks like searchingForm? I cannot find it either as a invokable or a factory.