Summernote for AutoForm v6.3.0
Add WYSIWYG editor to your Meteor app!
-
Install
meteor add aniskhan001:autoform-summernote
-
Install bootstrap and fontawesome (skip if already installed)
meteor add twbs:bootstrap
meteor add fortawesome:fontawesome
- Create schema
var BookSchema = new SimpleSchema({
title: {
type: String,
label: "Title",
max: 200
},
content: {
type: String,
label: "Yet another poem",
autoform: {
afFieldInput: {
type: 'summernote',
class: 'editor' // optional
settings: // summernote options goes here
}
}
}
});
-
Attach schema to your collection
Books.attachSchema(BookSchema)
-
Generate the form with
{{> quickform}}
or{{#autoform}}
{{> quickForm collection="Books" type="insert"}}
- Remember to sanitize the HTML on the server! Summernote doesn't do that, and even if it did, the client could always send HTML containing
<script>
tags.
See all available summernote options here.
See all available summernote calbacks here.