I have created a cms block in backend with the id wsmaterial. I have a modal that is created in a JavaScript file and the content for the modal should be the html from the cms block. Right now, it displays the id (wsmaterial) of the cms block, not the content.
In my features.js file:
var description = extendedOptionsConfig[option_id]['description'];
console.log(description); // => displays 'wsmaterial'
Instead of wsmaterial I want to get the content of the block with the id wsmaterial. Something like this:
var description = <?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('wsmaterial')->toHtml();?>
Is there any way of getting the content of the cms block in JS by the identifier?
Thank you!