I have programmatically created a CMS block, which is working fine. I've added some content into it and trying to display it in my homepage.

My block identifier is this_is_a_block_identifier. I'm trying to call it in content->pages->home page->edit by adding:

{{block class=Magento\Cms\Block\Block" block_id="this_is_a_block_identifier"}}

After, I'm clearing a cache. But instead of displaying a content, it just displays a text, which is that block class calling (as I showed above).



To call static block in cms page

 {{block  id="this_is_a_block_identifier"}}



It seems you have forget to use " before Magento\Cms so please use below code .

{{block class="Magento\Cms\Block\Block" block_id="this_is_a_block_identifier"}}

Looking at your question, it seems that you have typo mistake in calling the block.

{{block class=Magento\Cms\Block\Block" block_id="this_is_a_block_identifier"}}

should be

{{block class="Magento\Cms\Block\Block" block_id="this_is_a_block_identifier"}}

Notice the double quote before Magento.

  • I did that, but this doesn't help. I got just a text in my home page. – HELPME Aug 28 '18 at 10:41

A possibility is that your forgot to enable the block for the store view of your home page. There's a list widget just above the block content of the block edit page. You can use Ctrl + click to select multiple store view where the block should show up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.