Jump to content

How to make iframes with html content?


gklsmykker

Recommended Posts

Hi

 

I have some cool animations made in adobe edge animate, and I would like to put them on my webshop. They are in HTML5 and Javascript. I'm not at all smart enough to figure out how to add them into the raw code, so I thought the easiest way would be to make an iframe.

 

I have enabled iframes and disabled HTML purifier in preferences. And I've found some discussions that suggest, that I should also "comment out" the following lines in "Classes / validate.php":

 

        if (preg_match('/<[\s]*script/ims', $html) || preg_match('/('.$events.')[\s]*=/ims', $html) || preg_match('/.*script\:/ims', $html)) {
            return false;
        }
 
        if (!$allow_iframe && preg_match('/<[\s]*(i?frame|form|input|embed|object)/ims', $html)) {
            return false;
        }
 

But no matter what, it seems like I'm only able display media content in iframes, like Youtube videoes or regular images - but not html content. Can anyone please help?

 

I use Prestashop version 1.6.1.5.

 

Best regards

Grete Lauridsen

Link to comment
Share on other sites

You don't mention if you are trying to put the html in the small description or the large description. Most themes have code that will stripe out html from the small discrption because it is used in multiple areas such as category pages. HTML may look great on your product page but not so good on a category page. 

 

Here is an example of a line in the theme of product.tpl,

 

<p class="product_descr"  class="product_description">{$accessory.description_short|strip_tags|truncate:170:'...'}</p>

 

Look at the line, "strip_tags" will take out all html, and truncate:170:'...' will limit what is display to the first 170 characters.

Link to comment
Share on other sites

Hello Bill

 

Thank you very much for your reply - and sorry for my late reply. I've been away for the last couple of days.

 

Actually I want it on the frontpage (https://www.gklsmykker.dk/) - on the top hook in the standard theme (the two pictures to the right in the top). I've also tried on a CMS page with the same result. Actually I haven't tried it on product pages.

 

Is the iframe option only for product pages? If no, could you please tell me where to look for the code you gave me an example of?

 

Thank you very much

 

Best regards 

Grete

Link to comment
Share on other sites

Thanks everyone - and especially Vekia

 

I tried to install  tinymce editor but it doesnt' seem to make the iframes work. I can see the content of the iframe in preview mode when I edit the html in backoffice - but not anywhere else  :( 

 

(please see the attachements: Iframe_1 is the preview mode in the backoffice - Iframe_2 is what I see in front office - which is just blank)

 

post-1200786-0-78293100-1476525001_thumb.png

 

post-1200786-0-65800600-1476525002_thumb.png

 

Am I doing something wrong? - The iframe settings is still on allowed and the html purifier is disabled

 

UPDATE: tinymce treats the content as a video - it is an animation, so I guess that's right. I was thinking if there is anywhere where I can specify which video formats is allowed?

Edited by gklsmykker (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...