You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Online

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

#102794 How to use MediaBox to display a module in a modal popup?

Posted in ‘Mediabox’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by hboinnard on Friday, 07 February 2020 17:23 GMT

hboinnard
Hi Ryan,

Thank you very much for your awesome JCE editor and its plugins! I am using them on every website that I built. And I am a loyal subscriber since 2014.

I am looking at a solution to use MediaBox (lightbox style modal) for a Joomla module. Like with loadposition module-name and something like this. I have links to videos and images using JCE MediaBox already, with the style and CSS that I have customised, so I really want to keep the same look and feel website wide. And I would prefer not to use another extension just for a modal popup. It would increase the load of the page, and it will have lightbox JavaScript loaded twice.

Please could you let me know if there is a way to achieve this with JCE Mediabox?
Even if it implies writing some lines of code, or some template overrides, I will be fine, as long as I can re-use the solution on different pages.

I am pretty sure that there is a simple solution, but I can not recall it now. And I have search this forum (even from google), but to no avail
https://www.joomlacontenteditor.net/component/search/?searchword=module%20popup&searchphrase=all&Itemid=101

Kind regards,
Hervé

Ryan
In order to display the content of a single Joomla article in a popup, and not the whole site, MediaBox adds a &tmpl=component value to the url, so that Joomla renders just the article content, without any menus or modules. (You can try this yourself on one of the article urls on your site to see the effect)

This appears to include modules that are embedded in an article using loadposition, so for this reason, I don't think it is possible to display a module in a MediaBox popup.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

hboinnard
Thank you Ryan, this is helpful. An extra step, but it works. Then I tried with different modules, and I always have an extra content, making the JCE mediabox with a scroll bar on the right. I found out the cause, in the CSS class .wf-mediabox-content-ajax, so I can override it, but maybe there is a nicer way to do it?

.wf-mediabox-content-ajax {
    overflow: auto;
}
Kind regards, Hervé

Attachments

Ryan
I found out the cause, in the CSS class .wf-mediabox-content-ajax, so I can override it, but maybe there is a nicer way to do it?


That is what I would have suggested.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

hboinnard
Thanks Ryan, I appreciate that.

Have a nice weekend!
Herve