Skip to content

Commit

Permalink
Add documentation on ordered content types
Browse files Browse the repository at this point in the history
  • Loading branch information
tmilewski committed Aug 8, 2016
1 parent cdb19a5 commit 8b125d9
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,42 @@ ul
li= JSON.stringify(post)
```


### Ordered Content

In some cases you'll need to use a content model to maintain order of another content model. Take the following for example:

```
Case Study
- Title [Short Text]
- Client [Short Text]
...
```

```
Case Study Order
- Case Studies [References, many]
```

In order to pull formatted and ordered `case studies`, you'll need to use the following parameters:

```js
new Contentful({
addDataTo: locals,
accessToken: 'xxx',
spaceId: 'xxx',
contentTypes: [
{
name: 'case_studies', // Arbitrary name used from within templates
id: '633fTeiMaxxxxxxxxx', // This should point to the case_studies_order content type
ordered: true // Required. Appropriately format the related ordered content type
}
]
})
```

### Filters

#### Limit
Expand Down

0 comments on commit 8b125d9

Please sign in to comment.