Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
victorhmp committed Feb 3, 2020
1 parent f1af937 commit bb05ec4
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions docs/ProductSummaryList.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The `list-context.product-list` interface is a stance of the `list-context` interfaces, which means its part of a set of special interfaces that enables you to create lists of content that can be edited via Site Editor.

In order to create a list of products, you need to use `product-list-block` and `list-context.product-list` blocks.
In order to create a list of products, you need to use the `list-context.product-list` block and a `product-summary.shelf`.

## product-list-block

Expand All @@ -19,15 +19,13 @@ This block is used to specify what variation of `product-summary` to be used to
"product-summary-buy-button"
]
},
"product-list-block#demo1": {
"blocks": ["product-summary.shelf#demo1", "list-context.product-list#demo1"]
},
"list-context.product-list#demo1": {
"blocks": ["product-summary.shelf#demo1"],
"children": ["slider-layout#demo-products"]
},
```

`product-summary-block` is also the one that actually performs the GraphQL query that fetches the list of products, so it can receive the following props:
`list-context.product-list` is also responsible for performing the GraphQL query that fetches the list of products, so it can receive the following props:

| Prop name | Type | Description | Default value |
| ---------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
Expand All @@ -36,8 +34,4 @@ This block is used to specify what variation of `product-summary` to be used to
| `collection` | `String` | Filter by collection. | - |
| `orderBy` | `Enum` | Ordination type of the items. Possible values: `OrderByTopSaleDESC`, `OrderByReleaseDateDESC`, `OrderByBestDiscountDESC`, `OrderByPriceDESC`, `OrderByPriceASC`, `OrderByNameASC`, `OrderByNameDESC` | `OrderByTopSaleDESC` |
| `hideUnavailableItems` | `Boolean` | Hides items that are unavailable. | `false` |
| `maxItems` | `Number` | Maximum items to be fetched. | `10` |

## list-context.product-list

This is the interface that extends the `list-context` from `vtex.list-context`, and has `"composition": "children"` to enable this list to be composable with other contexts. It should not expect any props to be passed to it and just wraps its children with a `ListContextProvider` so that they have access to the list of `product-summary`s created by `product-list-block`.
| `maxItems` | `Number` | Maximum items to be fetched. | `10` |

0 comments on commit bb05ec4

Please sign in to comment.