storyblok / storyblok-astro

Astro SDK for Storyblok CMS
158 stars 29 forks source link

The ability to use `resolve_links` in Storyblok Bridge #882

Closed DMouayad closed 1 month ago

DMouayad commented 1 month ago

storyblok.com


Expected Behavior

I'm trying to find a way to have a text field that we can assign to it a link (the actual path - slug ) to a Story. After looking for a solution, I found there's a way to do this with a Link field and "resolve_links" option to get desired info (mainly the url - ful slug).

Current Behavior

Now the docs mentions this:

resolveRelations and resolveLinks will not have any effect in Astro, since the Storyblok Bridge is configured to reload the page. Thus, all the requests needed will be performed after the reload.

which is understandable but it also mentions the following:

The provided options will be used when initializing the Storyblok Bridge.

MY QUESTION is: Will we be able to use resolve_links or resolve_relations if it was provided in the bridge options?? I've already tried it but it didn't work.

what i tired:

storyblok({ bridge: { resolveLinks: "url" }, .... })


Thanks for ur amazing work & any help is much appreciated.

DMouayad commented 1 month ago

I'm sorry but it seems I didn't notice that changes weren't published. After publishing, all working as expected and I'm receiving the correct data responsešŸ”„.

mediabeastnz commented 1 month ago

It would be handy if we could use resolve_links when using useStoryblok(). Even if it doesn't work for live previews but worked when a page is rendered.

DMouayad commented 1 month ago

It would be handy if we could use resolve_links when using useStoryblok(). Even if it doesn't work for live previews but worked when a page is rendered.

@mediabeastnz I've yet to try if it works in live preview, it probably won't but for my use-case it won't be an issue, BUT both resolve_links and resolve_relations are working for me with storyblokApi.get() in SSG.