Skip to content

Instantly share code, notes, and snippets.

@luismec90
Created December 21, 2016 16:16
Show Gist options
  • Save luismec90/9654af5ef96f09b450c6b94a33385c01 to your computer and use it in GitHub Desktop.
Save luismec90/9654af5ef96f09b450c6b94a33385c01 to your computer and use it in GitHub Desktop.
<!doctype html>
<html class="" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="js-page-builder-container"></div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://pages.genndidev.com/pagebuilder.js"></script>
<script>
var $cdn = "http://localhost/";
var extraVars = JSON.stringify({
"$cdn":$cdn,
});
//Initialise the page builder
var initVars = {
//set element to inject builder into
element: 'js-page-builder-container',
//set template
template: 'wj/registration/1',
//(optional) pass changed elements
content: JSON.stringify({}),
//(optional) pass any instance specific JS variables (as strings - will be echoed as 'var $name = $value;' on the template)
extraVars: extraVars
};
pageBuilder.init(initVars);
//set behaviour for when 'save' is clicked (default is same as shown below)
pageBuilder.save = function(data) {
console.log(data);
}
//call builder
pageBuilder.activate();
$('#js-page-builder-container').css({
'position': 'absolute',
'width': '100%',
'height': '100%',
'z-index' : '1000'
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment