How To / General

Issues getting Moodle to display in a wrapper

  • Eric vanBok
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 9 months ago #11 by Eric vanBok
Replied by Eric vanBok on topic Issues getting Moodle to display in a wrapper
Actually that perfect information. When I display Moodle in a wrapper it is in a website that is using HTTPS. When I display Moodle in a new window is it displaying without HTTPS. If I change the URL in the new window so that it is using HTTPS rather than HTTP, I get the Moodle display I see in the wrapper.

So it is an HTTP/HTTPS issue. I will need to look at why this is happening and see about fixing it.

Thank you for the pointers in the right direction.

Please Log in or Create an account to join the conversation.

  • Eric vanBok
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 9 months ago #12 by Eric vanBok
Replied by Eric vanBok on topic Issues getting Moodle to display in a wrapper
For anyone else that ever has this issue here is the solution.

It is indeed an HTTP/HTTPS issue. Moodle in the wrapper was loading HTTPS, and the template didn't like that as it was now in a mixed HTTP/HTTPS system. I thought I had made enough changes to Moodle to get it to use HTTPS properly, but I didn't go far enough. I found this helpful article:

filippocarnevali.com/blog/setup-moodle-t...-with-https-and-ssl/

I just followed those instructions and it works like it should now.

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #13 by Antonio Durán
Replied by Antonio Durán on topic Issues getting Moodle to display in a wrapper
Good to know that you got it working. Thanks for posting the solution, I am sure it will help others.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago - 9 years 1 month ago #14 by ArchieBA
Replied by ArchieBA on topic Issues getting Moodle to display in a wrapper

Antonio Durán wrote: Hi.
Are Joomla on Moodle on same domain? It's required for wrapper auto-height to work.
Also, check that that you enabled allow frame embedding in Moodle config.


Is there a way to do it with two domains? I just purchased the subsciption today but didn't know this. Any help is appreciated. thanks

EDIT: well I saw your answer here: www.joomdle.com/forum/r09-support/11212-...n-are-different-help
Last edit: 9 years 1 month ago by ArchieBA.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #15 by Antonio Durán
Replied by Antonio Durán on topic Issues getting Moodle to display in a wrapper
As you can see in that post, Joomdle can work, but wrapper auto-height cannot if you use 2 domains, sorry. This is due to Javascript security restrictions.

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago - 8 years 11 months ago #16 by ArchieBA
Replied by ArchieBA on topic Issues getting Moodle to display in a wrapper
Hi,

Sorry to bumb this thread again but I came accross this post and was wondering if it could be possible to intergrate one of the solutions to joomdle for multiple domains?

stackoverflow.com/questions/22086722/res...domain-iframe-height

Thanks!!
Last edit: 8 years 11 months ago by ArchieBA.

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #17 by Antonio Durán
Replied by Antonio Durán on topic Issues getting Moodle to display in a wrapper
Hi.

Thanks for the link. I will take a look at it soon to see if we can add any solution to the different domains problem.

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago - 8 years 8 months ago #18 by Antonio Durán
Replied by Antonio Durán on topic Issues getting Moodle to display in a wrapper
Hi.

Sorry for taking so long, but I could finally try this out, and I am happy to say that it seems to be working fine for the auto-height on multiple domains.
I am going to put here all the steps required, and once you/others test, we can include a new config option in Joomdle to use this new auto-heihgt method, and document it properly.

I used this:
github.com/davidjbradshaw/iframe-resizer

This works by having a javascript file in Joomla and another one in Moodle.

Joomla:
Attached is new default.php file to put in components/com_joomdle/views/wrapper/tmpl (unzip firsrt)

File Attachment:

File Name: default.php-2.zip
File Size:1 KB


Also, you need to put iframeResizer.min.js (from link to github above) in components/com_joomdle/js

(all this would not be needed once this is merged to Joomdle package)

Moodle:
This will always be required, as you need to add the javascript file to your Moodle.
To do this, find the theme you are using in Moodle.
Then, create, if it does not exist, moodle/theme/YOUR_THEME/javascript
Upload iframeResizer.contentWindow.min.js to this new javascript folder (download from github link above)

Finally, add the new javascript file to your theme, by opening moodle/theme/YOUR_THEME/config.php and adding at the end:
$THEME->javascripts = array ( 'iframeResizer.contentWindow.min' );


After these steps, you should be able to have resizing iframe over different domains. I only tested it at one site, so please test and let us know your results.
Attachments:
Last edit: 8 years 8 months ago by Antonio Durán.

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #19 by ArchieBA
Replied by ArchieBA on topic Issues getting Moodle to display in a wrapper
After a quick first test, it seems to be working very well. But I will be able to look at it more closely next week, but so far so good :) thanks!! I'll post back when I have tested it better.

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #20 by Antonio Durán
Replied by Antonio Durán on topic Issues getting Moodle to display in a wrapper
Great, thank you very much for the feedback. I will wait for your comments when you test it more.

Please Log in or Create an account to join the conversation.