Skip to content

Commit e97c25b

Browse files
authored
Update README.md
1 parent a5f16bd commit e97c25b

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
Autoform File
22
=============
33

4-
### Description ###
4+
### Description
55
Upload and manage files with autoForm using ostrio:files.
66
This was ported from yogiben:autoform-file to use ostiro:files instead of the now deprecated CollectionFS.
77

8-
### Quick Start ###
9-
1) Install `meteor add ostrio:autoform-files`
10-
11-
2) Create your Files Collection (See [osiro:files](https://github.com/VeliovGroup/Meteor-Files.git))
8+
### Quick Start
9+
##### 1. Install `meteor add ostrio:autoform-files`
10+
##### 2. Create your Files Collection (See [ostrio:files](https://github.com/VeliovGroup/Meteor-Files.git))
1211
```javascript
1312
var Images = new FilesCollection({
1413
collectionName: 'Images',
@@ -33,7 +32,7 @@ if (Meteor.isServer) {
3332
});
3433
}
3534
```
36-
4) Define your schema and set the `autoform` property like in the example below
35+
##### 3. Define your schema and set the `autoform` property like in the example below
3736
```javascript
3837
Schemas = {}
3938

@@ -61,9 +60,8 @@ Posts.attachSchema(Schemas.Posts);
6160

6261
The `collection` property is the field name of your files collection.
6362

64-
5) Generate the form with `{{> quickform}}` or `{{#autoform}}`
65-
66-
e.g.
63+
##### 4. Generate the form with `{{> quickform}}` or `{{#autoform}}`
64+
e.g.:
6765
```
6866
{{> quickForm collection="Posts" type="insert"}}
6967
```
@@ -72,13 +70,13 @@ or
7270

7371
```
7472
{{#autoForm collection="Posts" type="insert"}}
75-
{{> afQuickField name="title"}}
76-
{{> afQuickField name="picture"}}
77-
<button type="submit" class="btn btn-primary">Insert</button>
73+
{{> afQuickField name="title"}}
74+
{{> afQuickField name="picture"}}
75+
<button type="submit" class="btn btn-primary">Insert</button>
7876
{{/autoForm}}
7977
```
8078

81-
###Multiple images###
79+
### Multiple images
8280
If you want to use an array of images inside you have to define the autoform on on the [schema key](https://github.com/aldeed/meteor-simple-schema#schema-keys)
8381

8482
```javascript
@@ -102,7 +100,7 @@ Schemas.Posts = new SimpleSchema({
102100
})
103101
```
104102

105-
### Customization ###
103+
### Customization
106104
You can customize the button / remove text.
107105

108106
Defaults:
@@ -127,7 +125,8 @@ picture: {
127125
}
128126

129127
```
130-
### Custom file preview ###
128+
129+
### Custom file preview
131130

132131
Your custom file preview template data context will be:
133132

@@ -153,7 +152,7 @@ picture: {
153152
</template>
154153
```
155154

156-
### Custom select/remove file buttons ###
155+
### Custom select/remove file buttons
157156

158157
Remember to add `js-af-select-file` and `js-af-remove-file` classes to nodes which should fire an event on click.
159158

@@ -181,7 +180,7 @@ picture: {
181180
</template>
182181
```
183182

184-
### Callbacks ###
183+
### Callbacks
185184

186185
**onBeforeInsert** - can be used to modify file (remember to return fileObj)
187186

0 commit comments

Comments
 (0)