DEV Community

Paboda Hettiarachchi
Paboda Hettiarachchi

Posted on

Using setTemplate to change a template file in layout

If a phtml file includes $block->getChildHtml, sub blocks are being defined in layout files. It will be too risky to redefine a set of blocks using referenceBlock tag.

<referenceBlock name="header-content">
<action method="setTemplate">
<argument name="template" xsi:type="string">Paboda_Sample::html/header.phtml</argument>
</action>
</referenceBlock>

Top comments (0)