1.0.1 • Published 5 years ago
Share package How to embed Brandgility's configurator into an iframe: get the id of template to be configured from Brandgility application To open an asset for customization, copy and paste below code into your page/component, replace :id in src attribute with your template's id: <iframe src="<BRANDGILITY_ENDPOINT>/embedded-template-configure/{new|edit}/:id?action=DRAFT_TEMPLATE_CONFIGURATION_START&eid=:id&embedded=true" />To configure an already saved template customization, copy and paste below code into your page/component, replace :id in src attribute with your saved template customization id: <iframe src="<BRANDGILITY_ENDPOINT>/embedded-template-configure/{new|edit}/:id?action=DRAFT_TEMPLATE_CONFIGURATION_EDIT&eid=:id&embedded=true" />API library Brandgility embedded api library allows you to issue commands to Brandgility configurator in embedded mode
Methods method description parameters onsubscribes to event eventName: <string>, argument: <function> emittriggers an event eventName: <string>, argument: <serializable, see The structured clone algorithm >
Events to listen To subscribe on event use on method: brandgilityEmbeddedApi.on('load', () => console.info('loaded'));event description arguments loadload event entity { type: <string> , id: <string> } savesuccess save event id of saved item <string> errorerror event error { message: <string> }
Events to trigger To trigger an event use emit method: brandgilityEmbeddedApi.emit('save');event description parameters savesaves a current version of template - saveAscreates a new saved customization from an existing saved customization new item { name: <string>, comments: <string> }