문제

I am trying to add a phtml template file to the layout file so that I can use this template in the head section to insert contents from an JS file. Please tell me what is the best way to do this?

도움이 되었습니까?

해결책

check below XML code

I have created a custom theme and create a default layout in the theme. I have added a template to head using below XML code.

<referenceContainer name="head.additional">
            <block class="Custom\Theme\Block\Template" name="custom_head" template="html/head.phtml" before="-"/>
</referenceContainer>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top