The links in my rich text field are wrong

In my rich text editor, i am linking to another document, but the link that is rendered, navigates to the same document.

In graphQL, this is the data i get back for the link:

<a  href=\"\">second part of this series</a>

Which seems odd?

Any help would be greatly appreciated!

Hello Tom walsh,

Welcome to the Prismic community.

When you integrating a Link to a Document in the Rich text filed, a Link Resolver function is necessary, when you render Rich text field in the frontend. Are you adding a Link Resolver function in your project? What framework are you using?

I am sending document link in javascript but you can find in other framework too:

Let me know if it still doesn't solve your issue.

Thanks,
Priyanka

Hey Priyanka, thanks for the reply!
I haven't worked with Link Resolvers before, but i can take a look into it.
I am using Gatsby on the front end.

Thanks,
Tom

Hey Priyanka, thanks for the link!
It sounds great!

Where do i use this function once its created?

Cheers!
Tom

Hello @tmwlsh

You have to follow this documentation:

And after creating linkResolver function pass this function to the Richtext where you are rendering this. Please find more details in this doc:Templating Rich Text fields - Prismic

Let me know if it still doesn't solve your doubt.

Thanks,
Priyanka

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.