Edit in GitHubLog an issue

Page Builder events

The pattern for consuming Page Builder events in JavaScript, such as within the preview.js component, is to import Magento_PageBuilder/js/events and use the events.on() method to bind to the event you want to handle, as shown here:

Copied to your clipboard
define([
'Magento_PageBuilder/js/events',
], function (events) {
'use strict';
events.on("event:name", function (args) {
// do logic
});
});

Events list

The following table lists the Page Builder events you can bind to and handle within your content type.

Content Type EventsStage Events
Column Events
Preview Events
Image Events
Other Events

Event details

contentType:* events

Events starting with contentType: are triggered for every content type on the stage. These events can also be called for specific content types by prefixing the content type's name before the event (name:event). For example:

  • text:createAfter
  • row:mountAfter
  • tab-item:mountAfter

contentType:createAfter

Copied to your clipboard
events.on("contentType:createAfter", function (params) {});
ParamsType
id
string
contentType
ContentType or ContentTypeCollection

Back to top

contentType:mountAfter

ContentType

Copied to your clipboard
events.on("contentType:mountAfter", function (params) {});
ParamsType
id
string
contentType
ContentType

ContentTypeCollection

Copied to your clipboard
events.on("contentType:mountAfter", function (params) {});
ParamsType
id
string
contentType
ContentTypeCollection
expectChildren
number

Back to top

contentType:dropAfter

Copied to your clipboard
events.on("contentType:dropAfter", function (params) {});
ParamsType
id
string
contentType
ContentType or ContentTypeCollection

Back to top

contentType:renderAfter

Copied to your clipboard
events.on("contentType:renderAfter", function (params) {});
ParamsType
id
string
element
HTMLElement
contentType
ContentType or ContentTypeCollection

Back to top

contentType:removeAfter

Copied to your clipboard
events.on("contentType:removeAfter", function (params) {});
ParamsType
contentType
ContentType or ContentTypeCollection
index
number
parentContentType
ContentType or ContentTypeCollection
stageId
string

Back to top

contentType:duplicateAfter

Copied to your clipboard
events.on("contentType:duplicateAfter", function (params) {});
ParamsType
originalContentType
ContentType or ContentTypeCollection
duplicateContentType
ContentType or ContentTypeCollection
index
number
direct
boolean

Back to top

contentType:moveBefore

Copied to your clipboard
events.on("contentType:moveBefore", function (params) {});
ParamsType
contentType
ContentType
sourceParent
ContentTypeCollection
targetParent
ContentTypeCollection
targetIndex
number
stageId
string

Back to top

contentType:moveAfter

Copied to your clipboard
events.on("contentType:moveAfter", function (params) {});
ParamsType
contentType
ContentType
sourceParent
ContentTypeCollection
targetParent
ContentTypeCollection
targetIndex
number
stageId
string

Back to top

contentType:redrawAfter

Copied to your clipboard
events.on("contentType:redrawAfter", function (params) {});

Backend

ParamsType
id
string
contentType
ContentType or ContentTypeCollection

Frontend

ParamsType
element
HTMLElement

Back to top

column:dragStart

Copied to your clipboard
events.on("column:dragStart", function (params) {});
ParamsType
column
ContentTypeCollection
stageId
string

Back to top

column:dragStop

Copied to your clipboard
events.on("column:dragStop", function (params) {});
ParamsType
column
ContentTypeCollection
stageId
string

Back to top

column:initializeAfter

Copied to your clipboard
events.on("column:initializeAfter", function (params) {});
ParamsType
column
Column
element
Element
columnGroup
ColumnGroup

Back to top

image:{{preview.contentType.id}}:assignAfter

Copied to your clipboard
events.on(`image:${this.contentType.id}:assignAfter`, function (params) {});
ParamsType
imageObject
File

Back to top

image:mountAfter

Copied to your clipboard
events.on("image:mountAfter", function (params) {});
ParamsType
id
string
contentType
ContentType
expectChildren
number

Back to top

image:uploadAfter

Copied to your clipboard
events.on("image:uploadAfter", function (params) {});
ParamsType
file
File

Back to top

stage:{{preview.contentType.stageId}}:readyAfter

Copied to your clipboard
events.on(`stage:${this.contentType.stageId}:readyAfter`, function (params) {});
ParamsType
stage
Stage

Back to top

stage:{{preview.contentType.stageId}}:renderAfter

Copied to your clipboard
events.on(`stage:${this.contentType.stageId}:renderAfter`, function (params) {});
ParamsType
stage
Stage

Back to top

stage:interactionStart

Copied to your clipboard
events.on("stage:interactionStart", function (params) {});
ParamsType
stageId
string

Back to top

stage:interactionStop

Copied to your clipboard
events.on("stage:interactionStop", function (params) {});
ParamsType
stageId
string

Back to top

stage:{{preview.contentType.stageId}}:fullScreenModeChangeAfter

Copied to your clipboard
events.on(`stage:${this.contentType.stageId}:fullScreenModeChangeAfter`, function (params) {});
ParamsType
fullScreen
boolean

Back to top

childContentType:sortStart

Copied to your clipboard
events.on("childContentType:sortStart", function (params) {});
ParamsType
instance
ContentTypeCollection
originalPosition
number
ui
JQueryUI.SortableUIParams

Back to top

childContentType:sortUpdate

Copied to your clipboard
events.on("childContentType:sortUpdate", function (params) {});
ParamsType
instance
ContentTypeCollection
newPosition
number
originalPosition
number
ui
JQueryUI.SortableUIParams
event
jQuery.Event

Back to top

stage:error

Copied to your clipboard
events.on("stage:error", function (params) {});
ParamsType
error
Error

Back to top

stage:{{preview.contentType.stageId}}:readyAfter

Copied to your clipboard
events.on(`stage:${this.contentType.stageId}:readyAfter`, function (params) {});
ParamsType
stage
Stage

Back to top

stage:{{preview.contentType.stageId}}:masterFormatRenderAfter

Copied to your clipboard
events.on(`stage:${this.contentType.stageId}:masterFormatRenderAfter`, function (params) {});
ParamsType
renderedOutput
string

Back to top

stage:updateAfter

Copied to your clipboard
events.on("stage:updateAfter", function (params) {});
ParamsType
stageId
string

Back to top

stage:childFocusStart

Copied to your clipboard
events.on("stage:childFocusStart", function () {});
ParamsType
None

Back to top

stage:childFocusStop

Copied to your clipboard
events.on("stage:childFocusStop", function () {});
ParamsType
None

Back to top

stage:viewportChangeAfter

Triggered on viewport changes in the Admin stage. Handle this event to control in your content type's widget (widget.js) for cases in which your content type is rendered on the Admin stage from within a Block or Dynamic Block. In these cases, Page Builder loads your widget, not the preview component, to the Admin stage. This means that your widget as to make changes to your content type when users change the viewports on the stage.

Copied to your clipboard
events.on(`stage:viewportChangeAfter`, function (args) {});
ArgsType
viewport
string
previousViewport
string

Back to top

stage:{{preview.contentType.stageId}}:viewportChangeAfter

Triggered on viewport changes in the Admin stage. Handle this event to control responsive changes to your content type from within your preview component.

Copied to your clipboard
events.on(`stage:${this.contentType.stageId}:viewportChangeAfter`, function (args) {});
ArgsType
viewport
string
previousViewport
string

Back to top

state

Copied to your clipboard
events.on("state", function (params) {});
ParamsType
state
DataStore

Back to top

{{config.name}}:{{preview.contentType.id}}:updateAfter

Copied to your clipboard
events.on(`${this.config.name}:${this.contentType.id}:updateAfter`, function (params) {});
ParamsType
contentType
ContentType

Back to top

googleMaps:authFailure

Copied to your clipboard
events.on("googleMaps:authFailure", function () {});
ParamsType
None

Back to top

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.