Adding a lightbox type method to open links or modules

Adding a lightbox type method to open links or modules

by Gilles-Philippe Leblanc -
Number of replies: 6

Hello,

We have some request for adding a display option that would open a module in a lightbox type window, ie as does dialog boxes in moodle.

It would require this type of display can be available in both display options resources where this type of display applies (file, page, url) but also as a way to open a link in tinymce.

We also received as a demand to perform a quiz in this type of window.

Do you know if works have been done in this regard in the community?

Thank you.

Attachment lightboxoption.png
Average of ratings: -
In reply to Gilles-Philippe Leblanc

Re: Adding a lightbox type method to open links or modules

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You could try this experiment I did a while ago:

https://github.com/davosmith/moodle-block_openiframe

In reply to Davo Smith

Re: Adding a lightbox type method to open links or modules

by Gilles-Philippe Leblanc -

I checked your experimentation and this is exactly what I need. We will therefore surely, with your permission of course, rely on some javascript code to create what we want.

 

Thank you again.

In reply to Gilles-Philippe Leblanc

Re: Adding a lightbox type method to open links or modules

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Feel free to take that code and do whatever you want with it - it was a little experiment to see if it worked, but I'm not intending to do anything further to it.

Just one point to note - there is a bit of a 'hack' in there, that relies on the block being installed on every page on the site. If the code detects it is within an iframe, then it hides the page header and blocks. You may find that this is better handled via your site theme, than in a block, but I'll leave it up to you to figure that bit out.

In reply to Davo Smith

Re: Adding a lightbox type method to open links or modules

by Gilles-Philippe Leblanc -

Thank you very much.

On the point of hiding regions blocks as well as the header, we had just come to the same conclusion.

Otherwise, on the use of the block, we thought in the first place more change the display settings of resources such as url, and page file to add a lightbox type display and second, to add in any way an option in TinyMCE. We do not want it to become the default choice but this to be configurable.

Finally, we are not sure of the exact location of the file on the javascript lightbox. We would like it to be modular and easily integrated into another environment to be able to share with the community. Block completed this need but we do not want to have to put in all the pages. Put this code in the theme would be pretty easy but limited scalability. Maybe just a module?

In reply to Gilles-Philippe Leblanc

Re: Adding a lightbox type method to open links or modules

by Bruno Henrique Cury -

What plugin is this shown in the picture?

How can open in lightbox a URL or Youtube video?


Thanks!