1

I know that we can add a custom block in the head as follows :

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="head.additional">
        <block class="Magento\Framework\View\Element\Template" name="block_name" template="path_to_file.phtml" />
    </referenceContainer>
</body>

but when i tried the same in admin i am unable to add the block, have tried following reference blocks till now :

<referenceContainer name="head">

<referenceContainer name="head.additional">

When i try adding block using

<referenceContainer name="content">

it works great but as i need to add dynamic name of the Google fonts i need it in <head> tag.

I am trying to add above code in backend's sales_order_view.xml

Any help will be great.

2
  • Have you find any solution for this? Commented Nov 27, 2017 at 7:09
  • Not at the time i needed, i managed to find a work around though. Commented Nov 28, 2017 at 8:02

1 Answer 1

1

You have to try with below code,

Replace

<referenceContainer name="head.additional">

With

<referenceBlock name="head.additional">

You have to use referenceBlock tag.

1
  • Have you solved your issue? Commented Jan 5, 2017 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.