Custom Events from Plattar Pages

You can add custom events that can be listened to by adding in a plattar schema into your button events in the Plattar CMS. The schema takes the form plattar:eventName?key=value&key2=value2

For example, you can send a message to your main website to show a product button being clicked in the Plattar page by using: plattar:productClicked?sku=1234 and then listening for it using the following:

comms.on('productclicked', function(data){
	console.log(data.sku);
	// Add whatever code you want to handle this event.
});