0

i have created form in phtml file, now instead of calling the phtml file on CMS page i wan t call it using iframe. is it possible?.

How we can crate and show form using iframe in magento 2

1 Answer 1

0

You cannot call directly a phtml from an iframe (or url for that matter). A template has logic that needs to be interpreted.
Not sure why you want to display something in an iframe, but you can do it this way.
Create another page that includes a block rendered by your phtml (you may want to set the layout for this page to 'empty') and then include an iframe in your other page with the url of the previously created page.

1
  • HI @Marius , thanks for your response. In general if we want ti show the form using Iframe on CMS page how will do that?
    – Mani
    Aug 1, 2023 at 7:17

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.