Static blocks in Magento 2

3 different ways to output static blocks.

CMS static blocks are blocks of content that can be that can be created and edited inside the Magento admin area. They're perfect for use as banners, promotions, return policies or any other type of content which may change regularly.

Demonstrated below are three different methods for outputting them in Magento 2 projects.

In a layout file.

<block class="Magento\Cms\Block\Block" name="" as="blockName">
        <argument name="block_id" xsi:type="string">block_id</argument>

In a template.

<?php echo $block->getLayout()
            ->toHtml(); ?>

In the CMS editor.

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