Using LightBox in template files

Hi. I would like to create some modal content that is triggered by clicking a button. I am not using the cornerstone builders for this particular page, so I am hoping there is a way to utilize the LightBox plugin (that it already integrated with Pro) for this, rather than having to load redundant scripts, or use a redundant additional plugin.

Are there any special css classes and/or data attributes I can use in my html that will trigger and configure the LightBox functionality? Something similar to the x-flexslider class and data-x-params="{...}" attribute for configuring FlexSlider elements?

Even if I have to use a little custom javascript to trigger the LightBox, it would be so great to be able to use what is already loaded and integrated into Pro, rather than having to find an additional redundant solution.

Let me know what’s easiest.

Thank you in advance. I’m loving the latest Pro version, by the way. The layout builders and new dynamic content options are an awesome new addition! Keep up the great work.

Hello @adaptifyDesigns,

Thanks for writing in! With the update of WordPress, the lightbox was no longer working because of their change in the Javascript. What you can do is to utilize the content area modal element. You can go to Pro > Global Blocks and create a custom block. This is where you insert the content area modal element, set up the toggle and contents of the modal. Once you are done, take note of the global block shortcode and then you can insert the shortcode as a slide in the classic slider. You may also inside the content area modal element in one of your columns on the page if needed.

Hope this makes sense.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.