Magento 2 Homepage Block – How to Show Block Content on Homepage

cms-blockhomemagento2

How to show a block content on homepage?

After install magento2 without sample data, I chose 'Magento Luma' theme and add 'Home Page Block' block and copy the code from the sample store.

but nothing show up on the home page, how to show my cms block on home page like sample store?

my home
enter image description here

sample store

enter image description here

Best Answer

in admin panel go to Content->Pages and edit home page and if you created your static block from admin panel add following to the Content tab

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

and if you created a custom block using a module add following to home page content tab

{{block class="Vendor\ModuleName\Block\BlockName" template="Vendor_ModuleName::yourcustomblock.phtml"}} 

then save the changes and flush magento cache and deploy/delete static contents now refresh home page .

If this was not worked let me know