Allow relative urls in Hyperlinks?

Hello!

I would like to inquire/request that Prismic allow relative links in link fields. Specifically, in the "hyperlink" content type in a rich text field.

I am using prismic content in a marketplace website with multiple environments, and we regularly link to other parts of the marketplace from the prismic content. It would be so much easier to just have an /other-page hyperlink than having to go in and change it to https://any-given-marketplace's-environment-url.com/other-page/ to avoid having to build a complex environment/base URL helper in the marketplace.

Do you have any other suggestions for incorporating relative URLs from the Prismic side?

Thank you!

Hi Jake,

Welcome to the community!

We have discussed this previously in this thread, our plan for this and a workaround which uses dummy documents in Prismic.

Thanks.

I'm using Prismic for certain parts on my website and also want to include relative links. To create dummy documents is not an option as there are too many non-prismic pages AND it makes the maintenance of the content too erroneous as pages have to be maintained in two locations.

Is there any solution other than a work-around by resolving the link object ourselves?

Hello @peter2, thanks for reaching out.

For the moment, the workarounds suggested in the original thread are the only way of handling this use case.

Hi @Pau, Is there any way to add an Option besides Link to Document, web and media - something like "Custom Link" that just keeps whatever was entered and doesn't automatically add https:// to the beginning?

For the moment there's no way to remove the https:// part of the web link. I'll add a feature request for it, as It'll be nice to be able to have it as a placeholder for readability.

2 Likes