openAppLightbox( )


Opens a lightbox that was added to a site by the Blocks app, during the app installation process and optionally passes it data.

The openAppLightbox() function returns a Promise that resolves to an object with data from the lightbox, when the lightbox is closed. Use it when a widget is installed as a lightbox.
Learn more about app and widget installation settings.

Note that to pass data back to the page that opened the lightbox, you must close the lightbox programmatically using the close() function. If the lightbox is closed by the site visitor clicking the 'X' icon, close button, or lightbox overlay, data will not be passed back the the page that opened the lightbox. Therefore, if you want to make sure data is passed back to the page that opened the lightbox, disable all of the methods mentioned above and create your own method for closing the lightbox programmatically. For example, you can add a button with an onClick event handler that calls the close() function.

Method Declaration
Copy
Method Parameters
lightboxIdstringRequired

The ID of the lightbox, as defined in the installation settings.


dataData

The data to pass to the lightbox.

Returns
Return Type:Promise<object>
Did this help?