# NextJS Slicemachines link only allows "web" links

**URL:** <https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463>\
**Category:** Developing with Prismic\
**Created:** [July 30, 2021, 3:15pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463 "2021-07-30T15:15:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dan/32/2382_2.png) [@dan](https://community.prismic.io/u/dan)\
**Post date:** [July 30, 2021, 3:15pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/1 "2021-07-30T15:15:12Z")

</div>

When using prismic normally, the "link" field allows 3 options - Web, Document, Media (unless you choose to refine it).

When using slicemachines it states that all 3 of these options are available

 ![Screenshot 2021-07-30 at 16.11.53](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/0/06e2de4ee34fc75220190e5e2fd08026a01715a0.png)

But when you actually publish your slice, you don't have the option to link to a document, or media item.

All you get are web links

 ![Screenshot 2021-07-30 at 16.13.31](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/b/b6395b7d0aaca1bec2f89dd2f31a0a054063ab16.png)

---

<div class="post-metadata">

**Author:** ![kris](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@kris](https://community.prismic.io/u/kris)\
**Post date:** [July 30, 2021, 4:25pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/2 "2021-07-30T16:25:43Z")

</div>

@dan I had the same issue 2 weeks ago - it's an easy solution, however I don't understand why this is the default

> [@Link fields only allow me to link to external URLs](https://community.prismic.io/t/link-fields-only-allow-me-to-link-to-external-urls/6206):
>
> Hello, I just started a new project using the new Slice machine and custom type builder. So far has been fantastic! However, I just added a Link field (I'm building the header custom type) and it only allows me to add external links. This is not a problem in my "Page" custom type. I'm not sure if I'm doing something wrong or if it's a bug The repo is [miso3.prismic.io](http://miso3.prismic.io) Thanks you, Kris

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dan/32/2382_2.png) [@dan](https://community.prismic.io/u/dan)\
**Post date:** [July 30, 2021, 8:47pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/3 "2021-07-30T20:47:11Z")

</div>

Interesting. Given how it's required to specify which custom type relationships exist I can understand why this is the default but it's weird that you don't have the option to change it.

Based on @samlittlefair's comment on your post it sounds like it should be editable from within prismic slicemachine, but even on the beta branch (which I'm using currently) there's no option to allow document relations even with custom type options

I wonder what the 'correct' solution is here? Random document links won't work unless you define every document relationship in the initial query (very inefficient), so just deleting the web type here doesn't really work as a solution.

I guess a perfect solution would be for the linkable documents to be selected, which then automatically adds queries to your fetchLinks property but that's definitely not how this works now.

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [August 2, 2021, 1:39pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/4 "2021-08-02T13:39:34Z")

</div>

A simple solution is to use the Content Relationship field instead. It is designed only to link internal documents.

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dan/32/2382_2.png) [@dan](https://community.prismic.io/u/dan)\
**Post date:** [August 2, 2021, 6:04pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/6 "2021-08-02T18:04:09Z")

</div>

Unfortunately, that doesn't solve the problem of using these link fields on buttons, or other similar link documents that can be either document links (prefetched) or external links (regular links).

This is a pretty common use case, especially in situations like header/footer navigations.

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [August 2, 2021, 6:14pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/7 "2021-08-02T18:14:58Z")

</div>

That is true. I understand that having both links in a Custom Type instead of covering all of the use cases isn't the most user-friendly option. But it's a workaround you can use to make internal links work.

We appreciate all of your feedback. I'll be sure to share it on the team's product board.

For the moment, we'll need to wait for the [new changes to be applied](https://github.com/prismicio/slice-machine/pull/117) in Slice Machine

---

<div class="post-metadata">

**Author:** ![kris](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@kris](https://community.prismic.io/u/kris)\
**Post date:** [August 9, 2021, 5:07pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/8 "2021-08-09T17:07:36Z")

</div>

@dan Just wanted to point out that my solution does work and I've been using it for my latest client project without any problems

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [August 11, 2021, 8:45am UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/9 "2021-08-11T08:45:16Z")

</div>

Hi Everyone,

Can you tell me what version of `slice-machine-ui` you are using?

Thanks.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [August 12, 2021, 10:38am UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/12 "2021-08-12T10:38:16Z")

</div>

OK, so I talked with the team and the field in this beta version of `slice-machine-ui` only supports 'links to web'. The content relationship supports 'links to documents' and neither supports 'links to media'.

I have requested the team to add support for all 3 of these cases to the link field. Hopefully this will be added in the next BETA release shortly.

I will update you here once this is done.

Thanks.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [August 20, 2021, 2:39pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/13 "2021-08-20T14:39:31Z")

</div>

This thread has been closed due to inactivity. [Flag to reopen](https://community.prismic.io/t/re-open-a-thread/2175).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [October 15, 2021, 9:50am UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/14 "2021-10-15T09:50:20Z")

</div>



---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dan/32/2382_2.png) [@dan](https://community.prismic.io/u/dan)\
**Post date:** [October 15, 2021, 9:53am UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/15 "2021-10-15T09:53:13Z")

</div>

Any ideas if this is still in the works? I'm still having to go into the models and manually update this to allow both types of links (web and document) which is definitely not ideal

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [October 15, 2021, 11:04am UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/16 "2021-10-15T11:04:35Z")

</div>

Hi Dan,

With the latest stable version of Slice Machine UI this should work, you'll need to update you Slices and push them to Prismic to get this functionality.

Thanks.

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dan/32/2382_2.png) [@dan](https://community.prismic.io/u/dan)\
**Post date:** [October 15, 2021, 4:04pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/18 "2021-10-15T16:04:42Z")

</div>

I've been working on 0.1.0 for the last 2 weeks and I'm still not seeing this. This is the latest release as far as I can tell, but if I go up to 0.1.0-beta-9 I still don't see any option to choose what type of link I'm creating.

Even if I create a new link I still don't see this

Am I missing something?

 ![Screenshot 2021-10-15 at 17.02.07](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/1/11c64b7efe45b39a9d24365c9f6558100ef765ae.png)

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [October 18, 2021, 8:51am UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/19 "2021-10-18T08:51:51Z")

</div>

Hi @dan ,

The latest version is [stable 0.1.0](https://www.npmjs.com/package/slice-machine-ui), so it's out of beta.

Try deleting your `node_modules` and `package-lock.json` files, then in your `package.json` change `slice-machine-ui` to `"slice-machine-ui": "^0.1.0"`.

Finally, run `npm install` again and you should have the latest version.

Thanks.

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dan/32/2382_2.png) [@dan](https://community.prismic.io/u/dan)\
**Post date:** [October 18, 2021, 12:41pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/20 "2021-10-18T12:41:17Z")

</div>

Hi @Phil,

I've deleted my `node_modules` folder and `yarn.lock` file but that hasn't changed the slice-machines-ui

It's at `^0.1.0` but what I'm seeing (after deleting everything, running yarn again and restarting the servers) is still the same as above.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [October 18, 2021, 1:54pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/21 "2021-10-18T13:54:03Z")

</div>

I'm going to test this on my side now to be sure.

Thanks.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [October 18, 2021, 3:33pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/22 "2021-10-18T15:33:45Z")

</div>

I'm seeing this behaviour also, it should have been shipped with this version. I'm following up with the team to get more information.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [October 18, 2021, 3:48pm UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/23 "2021-10-18T15:48:59Z")

</div>

So in the current version of `slice-machine-ui` the 3 types of links are 3 different fields:

- link to web
- link to media
- content relationship

I'm discussing with the team that the default link field should support all 3 of these use cases. Hopefully we'll get this for the next release. I'll update you here once I have more info.

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dan/32/2382_2.png) [@dan](https://community.prismic.io/u/dan)\
**Post date:** [October 19, 2021, 9:22am UTC](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463/24 "2021-10-19T09:22:33Z")

</div>

Great! It really doesn't make sense that it works this way as it's quite restricting (users regularly want to link both internally and externally) and the rich text links already work like this (where you can select any link type).

Thanks for looking into it.

[Next page](https://community.prismic.io/t/nextjs-slicemachines-link-only-allows-web-links/6463.md?page=2)
