1

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 `type` attribute to your `afFieldInput` component, or to a component that wraps an `afFieldInput` (such as `afFormGroup` or `afQuickField`), or to the `autoform` object 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.

4
  • data is inserted with html tags and attributes. if you want to render as html, you do not need to do anything. Commented Jan 27, 2016 at 11:27
  • 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 > Commented Jan 27, 2016 at 12:47
  • 1
    Use triple curly braces for html - {{{wydarzenie.content}}} Commented Jan 27, 2016 at 13:17
  • Thanks for the help. Commented Jan 27, 2016 at 13:30

1 Answer 1

1

Just to make it formal, I'm gonna add this as an answer as well and quote Ronak Nagda in his post:

Triple-curly braced template tags {{{…}}} are used to include raw HTML within your page. You should use these tags cautiously and make sure the HTML content here is safe and free from syntax errors.

In this case it would be {{{wydarzenie.content}}}

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.