Iframes not showing up in ojs 3.0.0

I tried adding youtube video to an announcement in my ojs 3.0 installation.

The problem is that I can clearly see the frame (and video) in the “editing window” of an announcement in my administration panel, but it is not visible in the main webpage.

here is the link to my journal:
www.npwtj.com

is this a bug or did I miss something like allowing iframes somewhere?
server is ec2, ubuntu instance.

This will be a restriction of the allowed_html setting and the htmlpurifier library.

See:

Thanks:

STEP-BY-STEP:

  1. edit the config.inc.php file in your ojs folder and edit the line allowed_html by adding iframe to it:

allowed_html = "a,....,iframe[frameborder|scrolling|style|src|width|height]>"

now the htmlpurifier library:
open the following file on the editor using a command:
$ pico /lib/pkp/classes/core/PKPString.inc.php
and find the line with htmlpurifier (using ctrl+W and writing htmlpurif)
edit the entry to contain these two lines:
$config->set('HTML.SafeIframe', true); $config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); //allow YouTube and Vimeo // This line is important allow iframe in allowed elements or it will not work

This worked for me. So there you have an updated tutorial how to include iframes.
REMEMBER THAT THESE ARE UNSAFE though.

2 Likes

How to visible image from google drive in announcement ojs 3.0.1?

@ceperlan, since this question isn’t directly related to enabling iframes in OJS 3.x, please post it as a new forum topic. That will helps others find the question and the answer(s).

Thank you for the information @ctgraham. this is my new forum topik : newtopic. help me please.