Meteoric Autoform change label type

166 views Asked by At

maybe I'm just to stupid to read the docs right, but I'm currently playing around with the meteoric package of meteor.js (ionic integration).

There is the "meteoric:autoform-ionic" package which controls the forms. I want to change the label type of the form that is generated by the following code:

{{> quickForm collection="Todos" id="insertTodosForm" type="insert" template="ionic" }}

The docs of the package are not that helpful. they say:

Support for multiple label types: Inline Labels (default) Placeholder Labels ('label-type': 'placeholder', placeholder: 'Label Here') Stacked Labels ('label-type': 'stacked') Floating Labels ('label-type': 'floating', placeholder: 'Label Here')

I dont know how to integrate this in my template.

Anyone familiar with this?

2

There are 2 answers

0
Lucas Blancas On

It looks like the documentation is implying that you to use #autoForm and apply the label-type and placeholder per field.

I couldn't prove this, but here's an example

{{#autoForm collection="Todos" id="insertTodosForm" type="insert" template="ionic" }}
    {{> afQuickField name='name' label-type="floating" placeholder="Name" }} 
    {{> afQuickField name='priority' label-type="floating" placeholder="Priority" }}
{{/autoForm}}
0
Louisswiss On

You have to include it in your SimpleSchema, eg:

name: {
    type: String,
    label: "name",
    autoform: {
      'label-type': 'stacked'
    },
    optional: true
  },