openLightbox( )


Opens a popup and optionally passes it the specified data.

Note: The terms popup and lightbox refer to the same element. While the editor and dashboard now refer to it as a popup, the API methods continue to use the term lightbox for backward compatibility. The documentation uses both terms accordingly.

The openLightbox() method opens a popup and allows you to pass data to it. Popups that are opened automatically on page load, or with a link from a page element don't receive passed data.

To ensure data can be passed:

  1. Call this method to open a popup programmatically. For example, add a button with an onClick event that calls openLightbox().
  2. Set Automatically display popup on pages to No in the popup's settings under Set Triggers.

If you pass data to a popup, call getContext() in the popup's code to access the received data.

Notes:

  • Use the name of the popup and not the popup's ID when calling openLightbox(). You can find the popup's name by selecting the popup and clicking the settings button.
  • Only call openLightBox() after the onReady() method, once all page elements have finished loading.
Method Declaration
Copy
Method Parameters
namestringRequired

Name of the popup to open.


dataData

Data to pass to the popup.

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