Websites opening in a Topic

Websites opening in a Topic

by Paul Jacobson -
Number of replies: 2
Usually, I create a Resources link to a Website that the user clicks to open fully on-screen or in another Window. Occasionally, the text in a Topic will contain a URL that opens a website in a similar way. Also, I have associated URLs with images (icons) with similar results. So far so good.

Lately I've been wondering if I could open a website within the frame of a topic; or even better, have a series of Tabs for the user to select which website to open in this way.

I'm halfway there with the following code placed in the HTML editor:

<style type="text/css"></style>
<script type="text/javascript"></script>
<iframe height="350" width="98%" id="tabiframe" src="http://www.google.com"></iframe>
<form name="tabcontrol" style="margin-top: 0pt;"></form>

I can scroll through the results of a Google search within the Topic Frame; but it will jump to full-screen if I click on any link. It just makes me even hungrier to find an elegant solution - particularly with Tabs along the top supplying the URLs.

Any suggestions?
Average of ratings: -
In reply to Paul Jacobson

Re: Websites opening in a Topic

by Itamar Tzadok -
Try the following:

<object height="350" width="98%" id="tabiframe" data="http://www.google.com"></object>

You shouldn't use iframes anymore anyway as they are not supported in later versions.

By the way, which Moodle version are you using? I don't get the behavior you are describing with iframes neither in a topic summary nor in a label. This behavior is usually tied to a page such that the page when opened makes itself the top frame.

hth smile
In reply to Itamar Tzadok

Re: Websites opening in a Topic

by Paul Jacobson -
Thanks Itamar for your suggestion - I've placed it in Topic 0 and it works fine . . . probably better than my attempt because it does not cause movement on the page.

The iFrame tag is not too bad. It will still be supported by HTML 5 with the addition of 2 new attributes. I like the "page within a page" feature, as a little window on the Web for researching references without leaving the Course. I've had no problems in Chrome, Firefox and IE8. I'm designing in Moodle 1.9.9.

Regards, PJ.