Is it possible to embed the page in a moodle page just like page resource?
I am new to moodle and now looking for any plugin or how to write a plugin for that. I have been keep studying the develop documents for quite a long period of time, but I still don't have any clue how to start with. It would great if anyone can give me some hints.
Thanks a lot.
The most direct way to do this would be to write a plugin, based on the most similar plugin already available in Moodle.
But if its just JS and CSS, you might be able to avoid writing a new plugin, by either:
i) just loading your custom pages up in an iframe within a page
or
ii) using the generico filter to create a template for your pages.
See : https://moodle.org/plugins/view.php?plugin=filter_generico
And a demo course here: http://demo.poodll.com
But if you need gradebook integration, reporting or closer forms of integration with Moodle, then a plugin would be best.
Re: [HELP] html+js(in multi-files)+css >>> page in moodle
Another possibility might be just to add all your files to a single "File" resource. Don't use the drag-and-drop method; instead turn editing on and use the activity/resource picker. Select "File" and then and all the files to the file picker. By default the first file is set to be the 'main' one, but if you delete the original main file you will be able to reassign that status to another file. If you set your HTML file as the main one and use relative paths to your <link> href's and <script> src's then the whole thing should work as you intend. You would have a link on the main course page that will open your HTML file where your scripts and CSS should apply.
Open up Chrome Developer Tools and look at the console tab. Do you see any interesting error messages in there?
It might not be this. But one possibility is cross domain issues. If your iframe, and/or resources loaded within it, are from a different domain than the Moodle site you need to configure the non-moodle server to allow that.
See: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
Thanks Justin.
You are right. There is error message in Chrome:
Mixed Content: The page at 'https://localhost/moodle/course/view.php?id=3#section-0' was loaded over HTTPS, but requested an insecure resource 'http://kbcmmoodle.0-host.net/NumStep0.html'. This request has been blocked; the content must be served over HTTPS.
Ok. So since you are on localhost, the simplest way out is just to switch https off for the Moodle site.
But if you want to use your 0-host.net site over https in production (or dev) you will need to setup ssl there, and then specify the src of your iframe to use the https url.
回應: Re: [HELP] html+js(in multi-files)+css >>> page in moodle
Thanks Justin.
Re: 回應: Re: [HELP] html+js(in multi-files)+css >>> page in moodle
Hi Hoi!
Where change http to https in the code?
Code theme?
Thanks!
Re: 回應: Re: [HELP] html+js(in multi-files)+css >>> page in moodle
If you just want to change the http/https part of the url from which your Moodle site is accessed, then you do that by editing the site's config.php file. Specifically the $CFG->wwwroot setting.
Thank you so much Justin and Kevin.