Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add custom preview documentation #309

Merged
merged 1 commit into from Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions reference-docs/server-configuration/config.md
Expand Up @@ -771,6 +771,31 @@ assetManagement: {
},
```

#### Custom previews

Added in: `release-2020-05`

Custom previews are a way to display a custom preview of a document. This could be a custom mobile preview, a preview of a finished article living on the frontend or anything that fits the specific customer need. You will need to enable the feature and register a custom render function that will contain the `documentId`.

mokimo marked this conversation as resolved.
Show resolved Hide resolved
```js
preview: {
enabled: true
}
```

```js
liServer.registerInitializedHook(async () => {
const previewApi = liServer.features.api('li-preview')
const renderFunction = async ({documentId}) => {
return {html: '<div>HTML FROM RENDER FUNCTION </div>'}
}
previewApi.registerRenderFunction(renderFunction)
}
```

![Teaser Preview](images/custom_preview.png)


## Integrations

Added in: `release-2020-04`
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.