Display CMS Static Block In Phtml File through code:
<?php
echo
$block
->getLayout()
->createBlock(
'Magento\Cms\Block\Block'
)
->setBlockId(
'block_identifier'
)
->toHtml();
?>
Display CMS Static Block In XML:
{{block class="Magento\Cms\Block\Block" block_id="block_identifier"}}
Display CMS Static Block In CMS Content:
<
referenceContainer
name
=
"content"
>
<
block
class
=
"Magento\Cms\Block\Block"
name
=
"block_identifier"
>
<
arguments
>
<
argument
name
=
"block_id"
xsi:type
=
"string"
>block_identifier</
argument
>
</
arguments
>
</
block
>
</
referenceContainer
>
No comments:
Post a Comment