How to use fancy box

Third party modules, patches, bugfixes
Post Reply
gihel
FormaLms User
Posts: 51
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

How to use fancy box

Post by gihel » Thu Sep 13, 2018 5:55 pm

Hi everibody
I just want to open a windows to present page web
Thank you

alfa24
FormaLms Expert
Posts: 185
Joined: Fri Nov 24, 2017 8:45 am
Version: forma.lms 1.4.2

Re: How to use fancy box

Post by alfa24 » Fri Sep 14, 2018 10:08 am

Can you explain? Where exactly in the platform would you need it?
I'm Jasmines, the One

gihel
FormaLms User
Posts: 51
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

Re: How to use fancy box

Post by gihel » Sat Sep 15, 2018 4:18 pm

when I write html code in a course, I would like create a buton to open a window with my own page html in a box
thank you

alfa24
FormaLms Expert
Posts: 185
Joined: Fri Nov 24, 2017 8:45 am
Version: forma.lms 1.4.2

Re: How to use fancy box

Post by alfa24 » Sat Sep 15, 2018 8:23 pm

In a course? What do you mean? In a learning object? Web page type?
I'm Jasmines, the One

gihel
FormaLms User
Posts: 51
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

Re: How to use fancy box

Post by gihel » Sun Sep 16, 2018 5:21 pm

Yes Learning object, HTML and inside htlm clic on button open fancybox or other box

alfa24
FormaLms Expert
Posts: 185
Joined: Fri Nov 24, 2017 8:45 am
Version: forma.lms 1.4.2

Re: How to use fancy box

Post by alfa24 » Sun Sep 16, 2018 8:11 pm

Never tried, but you could try with some javascript and use the lightbox of Forma.
I can do some test for you in the next days. What version of Forma are you using?
I'm Jasmines, the One

alfa24
FormaLms Expert
Posts: 185
Joined: Fri Nov 24, 2017 8:45 am
Version: forma.lms 1.4.2

Re: How to use fancy box

Post by alfa24 » Mon Sep 17, 2018 7:54 am

It seems you can't.
Lightbox is not initiated in the Web Page Learning Object type and you can't add script tag as it would be stripped by tinymce editor for security reasons.
You could try to modify function play in /appLms/class.module/learning.htmlpage.php file adding

Code: Select all

$GLOBALS['page']->add('<script type="text/javascript">var lb = new LightBox();
        var Config = {};
        Config.langs = {_CLOSE: "Chiudi"};
        lb.init(Config);</script>', 'content');
before the code:

Code: Select all

$GLOBALS['page']->add('<div id="top" class="std_block">'
			.getBackUi( str_replace( '&', '&amp;', $this->back_url ), Lang::t('_BACK'))
			.'<div class="title">'.$title.'</div>'
			.'<div class="textof">'.$textof, 'content');
And try with a <a rel="lightbox" href="your_destination"> link.
I'm Jasmines, the One

gihel
FormaLms User
Posts: 51
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

Re: How to use fancy box

Post by gihel » Wed Sep 19, 2018 3:54 pm

Thank you very much Alfa or Jasmine.
I try it and come back to say : ' It is wonderful!!! '

thank you so much

Post Reply