_filterProvider = $filterProvider; $this->_storeManager = $storeManager; $this->_blockFactory = $blockFactory; } /** * Prepare Content HTML * * @return string */ protected function _toHtml() { $blockId = $this->getBlockId(); $html = ''; if ($blockId) { $storeId = $this->_storeManager->getStore()->getId(); /** @var \Magento\Cms\Model\Block $block */ $block = $this->_blockFactory->create(); $block->setStoreId($storeId)->load($blockId); if ($block->isActive()) { $html = $this->_filterProvider->getBlockFilter()->setStoreId($storeId)->filter($block->getContent()); } } return $html; } /** * Return identifiers for produced content * * @return array */ public function getIdentities() { return [\Magento\Cms\Model\Block::CACHE_TAG . '_' . $this->getBlockId()]; } }