I'm trying to render a CMS Block, to pass rendered HTML to jsLayout, on updater
I have two CMS blocks, with same name, but for different store fronts (based on store front, the language is different).
Currently trying to get the HTML of the block, firstly tried $layoutInterface->renderElement and $layoutInterface->getBlock('block.name')->toHtml(), but without result, on first case it returns empty string, on second case it throws an exception that I'm trying to use ->toHtml on a boolean.
Following this: Get content of CMS block by identifier
I was able to get the block's HTML, but it returns me a block for a different store front. I would like to avoid messing with storefronts manually, but stuck right now and seeking for a better solution.
Would be grateful for any suggestions of how to get the right HTML of CMS block!
block.name
in yout? Is it custom block or\Magento\Cms\Block\Block
? When are you try to receive block content and what is store scope for?