Resolve relations with Storyblok Bridge
Changes in: app
It's now possible to resolve relations with the live updates from the input event of the Storyblok Javascript bridge.
If you call the function resolveRelations
the relations provided as second argument will be solved.
How to use?
You can use the storyblok bridge function .resolveRelations
.
window.storyblok.resolveRelations(storyObject, relationsToResolve, callbackWhenResolved)
in callback of the input event after the addComments function.
Example
window.storyblok.on('input', (event) => {
window.storyblok.addComments(event.story.content, event.story.id)
window.storyblok.resolveRelations(event.story, ['blog.author', 'blog.categories'], () => {
// event.story.content has now the resolved relations
// this.content = event.story.content
})
})