I installed “summernote: summernote” in “mpowaga:autoform-summernote”. Data entered in the editor Summernote writes in the collection of data using "SimpleSchema "in the form:
content: { type: String, label: "Treść wydarzenia", autoform: { afFieldInput: { type: 'summernote', class: 'editor', placeholder: 'Please add content...', settings:{ height: 150 } } } },
This is the example given in the database:
"content" : "<div>Beginning with AutoForm 4.0, there is advanced support for input types, including the ability to easily add custom input types (AKA form controls or \"widgets\"). An input type definition is essentially just a small template containing the markup plus a function that tells AutoForm how to obtain an input value from that template.</div><div><br></div><div>By default, AutoForm still automatically selects an appropriate input type based on examining the schema for each field. To override that behavior and choose your own type, you only need to add the
typeattribute to your
afFieldInputcomponent, or to a component that wraps an
afFieldInput(such as
afFormGroupor
afQuickField), or to the
autoformobject in your schema for the field.</div><div><br></div><div>Select an input type to see all the different ways in which that type can be used in your form. Select a schema type, open your browser console, enter a value, and click Submit to see how the value of the field is converted to the proper type requested by the schema.</div>"
How to read data ‘content’ of data collection in order to display the contained content as HTML rather than as text.
After baking such code:
<p> {{wydarzenie.content}} </ p>
in the template receives such a result in the browser:
<p> "<div> Beginning with AutoForm 4.0, there is advanced support for input types, Including the ability that easily add custom input types (AKA forms of controls or" widgets "). ...</ div> "</ p >