cancel
Showing results for 
Search instead for 
Did you mean: 

How to install iframe instead of product photos in magento 2

How to install iframe instead of product photos in magento 2

I need to place an iframe instead of photos on a product page in Magento 2. So that the user can view photos of the product and have the opportunity to open the video of the product in the iframe. The video should be in the same window where the photos were. iframe added as js extension. The problem is that I can’t place it in place of product photos.
file registration
<? php \ Magento \ Framework \ Component \ ComponentRegistrar :: register ( \ Magento \ Framework \ Component \ ComponentRegistrar :: MODULE , 
'Some-name' , __DIR__ );

layout

<? xml version = "1.0" ?> <  layout = "1columns"  xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"  xsi: noNamespaceSchemaLocation = "urn: magento: framework: View / Layout / etc / page_configuration.xsd " > 
<body>     
    <referenceContainer  name = " content " > 
        <block  class = " Magento \ Framework \ View \ Element \ Template "  template = " Some-name :: name.phtml "  /> 
    </ referenceContainer >

 

IFrame

<div data-mage-init = '{"hello": {"base_url": " <? php echo $ baseUrl ?> ", "store_Id": " <? php echo $ storeId ?> ", "product_Id": " <? php echo $ productId ?> "}} '> 
<iframe src = " http: some url " width = " 100 " height = " 100 " > / iframe> </ div>
2 REPLIES 2

Re: How to install iframe instead of product photos in magento 2

Hello @anna_moroz,

Please have a look on the answer I have replied in following link: https://community.magento.com/t5/Magento-2-x-Programming/How-to-install-iframe-in-magento-2-instead-...

I hope it will help you, if still you have any query, let me know.

If it helps you, please accept it as solution and give kudos.

Regards.

Re: How to install iframe instead of product photos in magento 2

Hello Sarvagya Pandey.
so i cant use my js module? I need to create a iframe as an attribute?