# Menu link with anchor link opening new tab

**URL:** <https://community.prismic.io/t/menu-link-with-anchor-link-opening-new-tab/1387>\
**Category:** Prismic for Content Creators\
**Created:** [July 30, 2020, 8:57am UTC](https://community.prismic.io/t/menu-link-with-anchor-link-opening-new-tab/1387 "2020-07-30T08:57:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![espen](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@espen](https://community.prismic.io/u/espen)\
**Post date:** [July 30, 2020, 8:57am UTC](https://community.prismic.io/t/menu-link-with-anchor-link-opening-new-tab/1387/1 "2020-07-30T08:57:25Z")

</div>

Hi

I have a menu item that i need to link to a particular section on a page using an anchor (#anchor). Since prismic doesn't seem so support using an anchor when "Link to a document...", i am using "Link to the web..." adding a static link to the page.

![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/5dd92128d026f9b490a6cfb628095164b446fec8.png)

However when clicking the meny item on the page, it opens a new tab, despite having the "Open in new tab" option unchecked.

Here´s the page (the menu item is "Hva koster det?"): [Selg billetter på nett | Hoopla Billettsystem](https://hoopla-staging.netlify.app/arranger/)

Anyone know why this behavior occur?

![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/d2c592024d4780285b36a5675cb0445dd65a7f3c.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:** [July 30, 2020, 11:36am UTC](https://community.prismic.io/t/menu-link-with-anchor-link-opening-new-tab/1387/2 "2020-07-30T11:36:42Z")

</div>

Hi Espen,

I’ll be happy to try and debug this with you.

Have you checked your API browser to see if the field is being return with the field target set to blank, like so?

```auto
"target": "_blank"

```

This will help us figure this out. You can find your browser here:  
[https://your-repo-name.prismic.io/api/v2](https://your-repo-name.prismic.io/api/v2)

Thanks.

---

<div class="post-metadata">

**Author:** ![espen](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@espen](https://community.prismic.io/u/espen)\
**Post date:** [July 30, 2020, 12:27pm UTC](https://community.prismic.io/t/menu-link-with-anchor-link-opening-new-tab/1387/3 "2020-07-30T12:27:07Z")

</div>

Thanks. Here u go: [https://hooplamarketing.prismic.io/api/v2](https://hooplamarketing.prismic.io/api/v2)

---

<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:** [July 30, 2020, 1:15pm UTC](https://community.prismic.io/t/menu-link-with-anchor-link-opening-new-tab/1387/4 "2020-07-30T13:15:19Z")

</div>

Great thanks.

So I can see that the target isn’t set to blank on that link “Hva koster det?”, but it is on the link after “Hva er nytt?”:

```auto
{
  "menu_item_text": "Hva koster det?",
    -"menu_item_link_url": {
      "link_type": "Web",
      "url": "https://hoopla-staging.netlify.app/arranger/#pris"
    }
},
-{
  "menu_item_text": "Hva er nytt?",
    -"menu_item_link_url": {
      "link_type": "Web",
      "url": "https://announcekit.app/hoopla/nyheter-for-arrangorer",
      "target": "_blank"
    }
}

```

This would suggest that this is being set in your website application, maybe hardcoded or cached somehow with this setting of `target:blank`. I inspected the code on the frontend of your website, but there was nothing that I could deduct from there as to why to button opens a new tab.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [September 23, 2020, 2:51pm UTC](https://community.prismic.io/t/menu-link-with-anchor-link-opening-new-tab/1387/5 "2020-09-23T14:51:20Z")

</div>

This issue has been closed due to inactivity.

---

<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:** [December 9, 2021, 3:04pm UTC](https://community.prismic.io/t/menu-link-with-anchor-link-opening-new-tab/1387/6 "2021-12-09T15:04:10Z")

</div>


