How to use fancy box

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

How to use fancy box

Post by gihel »

Hi everibody
I just want to open a windows to present page web
Thank you
alfa24
Senior Boarder
Posts: 1985
Joined: Fri Nov 24, 2017 8:45 am

Re: How to use fancy box

Post by alfa24 »

Can you explain? Where exactly in the platform would you need it?
Per supporto GRATUITO contattatemi in privato qui
gihel
FormaLms User
Posts: 76
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

Re: How to use fancy box

Post by gihel »

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
Senior Boarder
Posts: 1985
Joined: Fri Nov 24, 2017 8:45 am

Re: How to use fancy box

Post by alfa24 »

In a course? What do you mean? In a learning object? Web page type?
Per supporto GRATUITO contattatemi in privato qui
gihel
FormaLms User
Posts: 76
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

Re: How to use fancy box

Post by gihel »

Yes Learning object, HTML and inside htlm clic on button open fancybox or other box
alfa24
Senior Boarder
Posts: 1985
Joined: Fri Nov 24, 2017 8:45 am

Re: How to use fancy box

Post by alfa24 »

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?
Per supporto GRATUITO contattatemi in privato qui
alfa24
Senior Boarder
Posts: 1985
Joined: Fri Nov 24, 2017 8:45 am

Re: How to use fancy box

Post by alfa24 »

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.
Per supporto GRATUITO contattatemi in privato qui
gihel
FormaLms User
Posts: 76
Joined: Tue Jun 26, 2018 4:36 pm
Version: forma.lms 2.0

Re: How to use fancy box

Post by gihel »

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

thank you so much
Post Reply