yogiben:autoform-tags-toggle

v0.0.1Published 11 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Autoform Tags Toggle

User can togggle predefined tags.

alt tag

###Setup###

  1. Install meteor add yogiben:autoform-tags-toggle

  2. Define your schema and set the autoform property like in the example below

Schemas = {}

@Entries = new Meteor.Collection('entries');

Schemas.Entries = new SimpleSchema
	title:
		type:String
		max: 60
		
	tags:
		type: String
		autoform:
			afFieldInput:
				type: 'tags-toggle'
				tags: [
					'music',
					'book',
					# alternatively you can set different label than tag value:
					{ label: 'Movies', value: 'movies' }
				]

Entries.attachSchema(Schemas.Entries)
  1. Generate the form with {{> quickform}} or {{#autoform}}

e.g.

{{> quickForm collection="Entries" type="insert"}}

or

{{#autoForm collection="Entries" type="insert"}}
    {{> afQuickField name="title"}}
    {{> afQuickField name="tags"}}
    <button type="submit" class="btn btn-primary">Insert</button>
{{/autoForm}}

Tags will be comma separated string.