From 819efdd30425d34725586fd4af4b2c58d7adf1bd Mon Sep 17 00:00:00 2001 From: Tom Kraak Date: Sun, 14 Aug 2016 14:18:00 -0400 Subject: [PATCH] fix link to Contentful docs and add code example (#153) --- readme.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index c197f2d..3d4ba71 100644 --- a/readme.md +++ b/readme.md @@ -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