4

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).

Why?

4 Answers 4

4

To call static block in cms page

 {{block  id="this_is_a_block_identifier"}}

Reference

3

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"}}
1

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.

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

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 and acknowledge you have read our privacy policy.

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