misc edits in /docs; mostly style, grammar, consistency (#489)
* misc edits in /docs; mostly style, grammar, consistency * changes per reviewers requests * removed .md ext from links in 2 files per request
This commit is contained in:
committed by
Jessica Parsons
parent
b283f6931f
commit
6ad6bfd094
@ -1,11 +1,11 @@
|
||||
# Customizing the Preview Pane
|
||||
|
||||
The NetlifyCMS exposes an `window.CMS` global object that you can use to register custom widgets, previews and editor plugins. The available customization methods are:
|
||||
The NetlifyCMS exposes a `window.CMS` global object that you can use to register custom widgets, previews and editor plugins. The available customization methods are:
|
||||
|
||||
* **registerPreviewStyle** Register a custom stylesheet to use on the preview pane.
|
||||
* **registerPreviewTemplate** Registers a template for a collection.
|
||||
* **registerPreviewStyle:** Register a custom stylesheet to use on the preview pane.
|
||||
* **registerPreviewTemplate:** Registers a template for a collection.
|
||||
|
||||
Explore the [NetlifyCMS GitHub example](https://github.com/netlify/netlify-cms/blob/9ced3f16c8bcc3d1a36773b126842d023c589eaf/example/index.html#L90-L91) has a working example to review on GitHub.
|
||||
Explore the [NetlifyCMS GitHub example](https://github.com/netlify/netlify-cms/blob/9ced3f16c8bcc3d1a36773b126842d023c589eaf/example/index.html#L90-L91), a working example you can review on GitHub.
|
||||
|
||||
### React Components inline interaction
|
||||
|
||||
@ -59,10 +59,10 @@ Registers a template for a collection.
|
||||
|
||||
* collection: The name of the collection which this preview component will be used for.
|
||||
* react_component: A React component that renders the collection data. Four props will be passed to your component during render:
|
||||
* entry: Immutable collection containing the entry data.
|
||||
* widgetFor: Returns the appropriate widget preview component for a given field.
|
||||
* [widgetsFor](#lists-and-objects): Returns an array of objects with widgets and associated field data. For use with list and object type entries.
|
||||
* getAsset: Returns the correct filePath or in-memory preview for uploaded images.
|
||||
* entry: Immutable collection containing the entry data.
|
||||
* widgetFor: Returns the appropriate widget preview component for a given field.
|
||||
* [widgetsFor](#lists-and-objects): Returns an array of objects with widgets and associated field data. For use with list and object type entries.
|
||||
* getAsset: Returns the correct filePath or in-memory preview for uploaded images.
|
||||
|
||||
**Example:**
|
||||
|
||||
@ -87,7 +87,7 @@ Registers a template for a collection.
|
||||
```
|
||||
|
||||
### Lists and Objects
|
||||
The API for accessing the individual fields of list and object type entries is similar to the API
|
||||
The API for accessing the individual fields of list- and object-type entries is similar to the API
|
||||
for accessing fields in standard entries, but there are a few key differences. Access to these
|
||||
nested fields is facilitated through the `widgetsFor` function, which is passed to the preview
|
||||
template component during render.
|
||||
@ -102,7 +102,7 @@ Registers a template for a collection.
|
||||
<script>
|
||||
var AuthorsPreview = createClass({
|
||||
// For list fields, the widgetFor function returns an array of objects
|
||||
// which you can map over in your template. If our field is a list of
|
||||
// that you can map over in your template. If our field is a list of
|
||||
// authors containing two entries, with fields `name` and `description`,
|
||||
// the return value of `widgetsFor` would look like this:
|
||||
//
|
||||
@ -178,7 +178,7 @@ Registers a template for a collection.
|
||||
### Accessing Metadata
|
||||
Preview Components also receive an additional prop: `fieldsMetaData`. It contains aditional information (besides the plain plain textual value of each field) that can be useful for preview purposes.
|
||||
|
||||
For example, the Relation widget passes the whole selected relation data in fieldsMetaData.
|
||||
For example, the Relation widget passes the whole selected relation data in `fieldsMetaData`.
|
||||
|
||||
```js
|
||||
export default class ArticlePreview extends React.Component {
|
||||
|
Reference in New Issue
Block a user