In this minimal example I have two schemas, one for a Person and another called “Groups” that defines a collection. Using autoform, I want to apply a custom template to any occurrence of PersonSchema, regardless of the parent schema.
SimpleSchema.PersonSchema = new SimpleSchema({
firstName: {
type: String,
optional: false,
label: "First Name"
},
lastName: {
type: String,
optional: false,
label: "Last Name"
}
});
Groups = new Mongo.Collection('groups');
Groups.attachSchema(new SimpleSchema({
name: {
type: String,
optional: false,
label: "Group Name"
},
people: {
type: [SimpleSchema.PersonSchema],
minCount: 1
}
}));
I understand that I can attach a template to the autoform via the template attribute as well as some additional classes like so:
{{> quickForm id="addGroupForm" collection="Groups" type="insert" template="bootstrap3-horizontal" label-class="col-sm-3" input-col-class="col-sm-9"}}
How can I create a template for just the “Person” section of the form?