April 3, 2016 at 4:58 PM #308462
So I’ve tried:
1) For php: I set the type as “php script”. The help for this says that the code will just be put in a div, great. So I hit edit and typed in to the edit window:
echo “Hello world!<br>”;
And hit “Run” – nothing, just the still image of the HTML extension. Then I thought maybe it was automatically php, so I tried just:
echo “Hello world!<br>”;
and hit “Run”. Still nothing. How do I get anything to actually happen with this HTML extension object?
2) For iFrame: And then more importantly, since I need an iFrame (which I can build with php or any other language if I can get that to work).
In the help, there’s nothing for the “other” type, but there is help for a “custom div” which doesn’t exist, so I went with that. I tried just with a youtube video (Yes, I know there is a YouTube object, but my goal is not a YouTube video – but if I can get the iFrame to show a YouTube video, I can get it to show anything else):
okay, I have valid html, but to get it to appear here I’ve had to mod it to not actually register.
iframe width=”420″ height= “315”
Nothing. So in case I need the full html, I tried:
iframe width=”420″ height= “315”
Still nothing. Does anyone know how to make the HTML Extension object actually do/show anything?
Thanks.April 4, 2016 at 4:21 AM #308500
There are two ways to add external web content to Lectora. For non-technical authors, there’s Web Window. Just insert it, type in the URL, click OK. For more technical people, there’s External HTML Object. Just insert it, set it to Custom Div, type in whatever HTML code you want (e.g. the code for iframe).
I recorded a 2-minute video for you showing both approaches: https://www.youtube.com/watch?v=3nc7FNzpr1w
As for PHP, you have to use the <? or <?php format and upload the files to a PHP server before you preview. Lectora’s preview will not execute PHP for you.
Also, choosing a YouTube link for experimenting with iframe embeds is a bad decision because YouTube does not allow embedding its videos in this way. It will not work in Lectora, outside Lectora, or anywhere else. You should use the following link format: https://www.youtube.com/embed/3nc7FNzpr1w – note the “embed” part in it.This post has received 3 votes up.April 4, 2016 at 11:48 AM #308759
Thanks so much for the reply and the video. I appreciate it, and the information. It works. Very helpful!
I’m using Lectora Online, and can’t find the Web Window button – I suspect perhaps I don’t have it. Where you have that in your video, along with the social and RSS feed – I have none of that. So, a difference in the program, perhaps, but just for your reference in case you answer other newbie questions in the Lectora Online forum. So I’m referring only to the video start at 1min in for the HTML extension – but I don’t have “Custom Div” as an object type, so I’m using “Other”. (when I click help in Lectora Online, it has documentation on the custom div, but unfortunately Lectora Online doesn’t have that, so it’s a little disappointing the documentation isn’t for “other”…).
Anyway, I copied yours exactly, except using Other instead of Custom Div, and it worked perfectly. Thanks so much!
One other thing – do you know how to make this resize with the size of the window? I thought I made a responsive project, but when I preview it and shrink / expand my browser window, nothing changes size – not the slide itself nor the iFrame. It just crops. I can’t figure this out. Thanks!April 4, 2016 at 1:16 PM #308822
Ah, it looks like that template just didn’t support being responsive – I found a responsive template. But the iFrame still gets cropped. I wonder if this is an issue of the size and width settings – setting it to a percentage, I have scrollbars, so unless you know a better idea, I’ll stick with this. Thanks!April 5, 2016 at 3:01 AM #308996
Right, Web Window is only available in Lectora Desktop, and Custom Div is called “Other” in LO. But it is easily emulated using Ext HTML object and I’m happy to hear you got that working.
As for responsive iframes, I’m not sure how that can be achieved yet, I might need to play with the RCD features a bit more 🙂April 5, 2016 at 3:14 AM #309007
Okay, here’s the solution. If you use the following code for iframe, it will always fill 100% of the Ext HTML Object. And since that object is responsive, the iframe will be responsive too! Here’s a live demo, try resizing your browser to see how the Wikipedia embedded page resizes.
<iframe src=https://wikipedia.org style="width:100%; height:100%"></iframe>This post has received 2 votes up.April 5, 2016 at 9:36 AM #309084
Ah, yeah, I was using percentages! I see that it does work with wiki, so I guess it’s more a problem with what I’m trying to embed in the iFrame. In that case, since the iFrame works great, I’ll figure that out. Thanks so much for all your quick responses!October 4, 2017 at 9:35 AM #373096
Does anybody know how to pass a JS variable from within an iframe to Lectora?
I have been using Captivate files (swf) and a HTML header script to link the JS variable from Captivate to an action group in Lectora for years without problems but I’m trying to use HTML5 now and can’t seem to get it to work. The JS is still being fired from the HTML5 content in the iframe, it just isn’t being picked up in Lectora.
I read somewhere that the variable has to be initialised first, so I have tried that. I have also tried calling the Action Group directly from the html5 in the iframe as well, bypassing the header script, but that didn’t work either.
I’m out of ideas now. Any help would be greatly appreciated.
You must be logged in to reply to this topic.