Created
June 6, 2017 15:32
-
-
Save tomasdev/0d4825e38e27985eda4819c3e0c0e674 to your computer and use it in GitHub Desktop.
Minimum HTML required for a Contentful extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- the following is optional --> | |
<link rel="stylesheet" type="text/css" href="https://unpkg.com/contentful-ui-extensions-sdk@2/dist/cf-extension.css"> | |
</head> | |
<body> | |
<h1>Hello World</h1> | |
<script src="https://unpkg.com/contentful-ui-extensions-sdk@2"></script> | |
<script> | |
window.contentfulExtension.init(extension => { | |
extension.window.startAutoResizer(); | |
let value = extension.field.getValue(); | |
console.log('Value received', value); | |
// Call extension.field.setValue('new value'); whenever you want to update it | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment