Skip to content

Commit

Permalink
fix link to Contentful docs and add code example (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkraak authored and jescalan committed Aug 14, 2016
1 parent 72c847c commit 819efdd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,23 @@ Optional. Path relative to the roots project of a template for a single entry vi

#### filters

Optional. Takes an object with different filter criteria, see examples of how to structure the object in [Contentful's docs](https://www.contentful.com/developers/documentation/content-delivery-api/javascript/#search-filter).
Optional. Takes an object with different search and filter criteria. See examples of how to structure the object in [Contentful's docs](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters).

For example, the following [limits](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/limit) the API response to 5 entries, [filters](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/array-equalityinequality/query-entries) by the `feature` field and [orders](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/order) items in the response by the `sys.createdAt` property. Notice the minus sign, which reverses the sort order.

```coffee
content_types:
blog_posts:
id: 'xxxxxx'
template: 'views/_post.jade'
path: (entry) -> "blog/#{entry.permalink}"
filters: {
'limit': '5',
'fields.feature': 'true',
'order': '-sys.createdAt'
}
transform: transformFunction
```

#### path

Expand Down

0 comments on commit 819efdd

Please sign in to comment.