Answers for "static block in phtml magento 2"

1

magento2 add static block in phtml

<?= $block->getChildHtml('my-main-phtml-block-cms') ?>
Posted by: Guest on June-04-2021
1

magento2 add static block in phtml

<referenceBlock name="my-main-phtml-block">    <block class="MagentoCmsBlockBlock" name="my-main-phtml-block-cms">        <arguments>            <argument name="block_id" xsi:type="string">my_cmsblock_identifier</argument>        </arguments>    </block></referenceBlock>
Posted by: Guest on June-04-2021
0

magento 2 add in static block

<?php    echo $this->getLayout()        ->createBlock(MagentoCmsBlockBlock::class)        ->setBlockId('my_cmsblock_identifier') //replace my_cmsblock_identifier with real CMS bock identifier        ->toHtml();?>
Posted by: Guest on June-04-2021

Code answers related to "static block in phtml magento 2"

Browse Popular Code Answers by Language