0

I have created a custom module and trying to show the iframe in admin area.

Created a new action and able to access the url in browser.

Layout look like

app/code/VENDOR/MODULE/view/adminhtml/layout/VENDOR_MODULE_registration_index.xml

Template look like

app/code/VENDOR/MODULE/view/adminhtml/templates/test.phtml (it contain the iframe as <iframe src="https://www.google.com"></iframe>)

I have tried

<body>
    <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template" name="One" template="VENDOR_MODULE::test.phtml" />
    </referenceContainer>
</body>

OR

<body>
    <container name="root" label="Root">
        <block class="Magento\Framework\View\Element\Template" name="One" template="VENDOR_MODULE::test.phtml" />
    </container>
</body>

But the custom phtml file does not render on the browser?

How to set custom HTML content/iFrame in the admin area?

0

I have debug it more and found that the layout file name is wrong. The correct file should be

FRONTNAME_registration_index.xml

frontName is defined in routes.xml.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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