Elxis CMS Forum

Support => Elxis 4.x/5.x DEV => Topic started by: bully on March 30, 2019, 17:06:45

Title: Simply Stuck
Post by: bully on March 30, 2019, 17:06:45
having the following issue:

Opening a form as lightbox window ... from a menu, that works.
However, to open the same form from a text link as lightbox window .... what is the magic behind?

I am sure, that has been asked and answered before, but I not find any q or a to that


thx for tipp-off
Bully
Title: Re: Simply Stuck
Post by: datahell on April 01, 2019, 23:41:36
Lightbox should be preloaded in your template with this command:
eFactory::getDocument()->loadLightbox(); (Elxis 4.x uses colorbox)

Then you must bind colorbox to the item. There are many ways to do it. I write a simple example:

<a href="javascript:void(null);" onclick="$.colorbox({iframe:true, innerWidth:650, innerHeight:400, href: 'http://www.example.com/inner.php/myform.html'});">Open form</a>


In Elxis 5.x you can also use mediabox:
eFactory::getDocument()->loadMediabox();

Then  things are simpler:
<a href="http://www.example.com/inner.php/myform.html" data-mediabox="myform" data-iframe="true" data-width="650" data-height="400">Open form</a>
Title: Re: Simply Stuck
Post by: bully on April 02, 2019, 07:14:01
Thx,
I am obviously not the brightest candle in dark, neither in daylight, so I ask to maybe understand:
As I just started that one recently, elxis 4.6 I think, just started recently, so should be latest
"Lightbox should be preloaded in your template with this command:  eFactory::getDocument()->loadLightbox(); (Elxis 4.x uses colorbox)"
This should be already? it all works, when I use the menu ... I really hope, elxis 5.x will my ease my life
Title: Re: Simply Stuck
Post by: datahell on April 02, 2019, 19:36:27
The menu modules does the hard job automatically.

If you want to add a custom lightbox window (for example inside an article) you have to do the hard work by yourself like I saw you.
Title: Re: Simply Stuck
Post by: bully on April 02, 2019, 23:24:53
<a href="javascript:void(null);" onclick="$.colorbox({iframe:true, innerWidth:650, innerHeight:400, href: 'http://www.example.com/inner.php/myform.html'});">Open form</a>


That was all, what was needed. I just had to change a bit the height and width to match that form.

Thx a lot ;)