Legacy Templates

If you are moving to Unlayer from a classic rich text editor, you can use our classic mode and let your users manage legacy templates and designs.

In classic mode, there is no JSON and templates are loaded and exported using HTML only.

Load Design

You can load the legacy design like this.

  html: '<html><body><div>This is a legacy HTML template.</div></body></html>',
  classic: true

Export Design

The export function will return HTML.

unlayer.exportHtml(function(data) {
  var html = data.html; // final html

  // Do something with the html

Update Event

unlayer.addEventListener('design:updated', function(data) {
  var type = data.type; // html:updated 
  console.log('design:updated', type);

Full Example

We have a full example of legacy template. Check it out