Skip to content

Commit

Permalink
📝 Documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zurawiki committed Apr 26, 2018
1 parent 49a5a61 commit 0d9f19a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/site/content/docs/widgets/relation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The relation widget allows you to reference items from another collection. It pr
- **Options:**
- `default`: accepts any widget data type; defaults to an empty string
- `collection`: (**required**) name of the collection being referenced (string)
- `displayFields`: list of one or more names of fields in the referenced collection that will render in the autocomplete menu of the control. The value field is used by default.
- `displayFields`: list of one or more names of fields in the referenced collection that will render in the autocomplete menu of the control. Defaults to `valueField`.
- `searchFields`: (**required**) list of one or more names of fields in the referenced collection to search for the typed value
- `valueField`: (**required**) name of the field from the referenced collection whose value will be stored for the relation
- **Example** (assuming a separate "authors" collection with "name" and "twitterHandle" fields):
Expand All @@ -23,8 +23,8 @@ The relation widget allows you to reference items from another collection. It pr
name: "author"
widget: "relation"
collection: "authors"
displayFields: ["twitterHandle", "followerCount"]
searchFields: ["name", "twitterHandle"]
valueField: "name"
displayFields: ["twitterHandle", "followerCount"]
```
The generated UI input will search the authors collection by name and twitterHandle as the user types. Each collection will be represented by the author's handle and follower count. On selection, the author name will be saved for the field.
The generated UI input will search the authors collection by name and twitterHandle, and display each author's handle and follower count. On selection, the author name will be saved for the field.

0 comments on commit 0d9f19a

Please sign in to comment.