# Forcing menu link to open in a new window?

**URL:** <https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108>\
**Category:** Questions\
**Tags:** v2\
**Created:** [January 23, 2016, 8:23am UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108 "2016-01-23T08:23:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurtg](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@kurtg](https://forum.getkirby.com/u/kurtg)\
**Post date:** [January 23, 2016, 8:23am UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/1 "2016-01-23T08:23:28Z")

</div>

Hello,

I would like to have one of my site menu links open a page in a new window/tab. I have found the documentation to make this work for embedded links on pages using Kirbytext (target: blank, popup: yes) but have found no way to apply this to an actual menu item. Any thoughts?

Thanks in advance.  
Kurt

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 23, 2016, 9:38am UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/2 "2016-01-23T09:38:28Z")

</div>

This is not Kirby specific but general HTML knowledge. Set the target attribute to “\_blank”.

```php
<a href="http://www.link.de" target="_blank">Visit this link</a>

```

---

<div class="post-metadata">

**Author:** ![kurtg](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@kurtg](https://forum.getkirby.com/u/kurtg)\
**Post date:** [January 23, 2016, 10:40am UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/3 "2016-01-23T10:40:50Z")

</div>

Thank you for the quick response. This makes good sense to me but where (in which Kirby file) do I actually alter the code for this particular menu item?

Kurt

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 23, 2016, 10:42am UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/4 "2016-01-23T10:42:17Z")

</div>

In your menu snippet, if you are using the Starterkit, that will be in /site/snippets/menu.php

---

<div class="post-metadata">

**Author:** ![josh.peterson](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/josh.peterson/32/2649_2.png) [@josh.peterson](https://forum.getkirby.com/u/josh.peterson)\
**Post date:** [August 17, 2016, 9:52pm UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/5 "2016-08-17T21:52:28Z")

</div>

Going to hijack this thread to ask if there’s a way to make the link button in a textarea field always generate markup that already has target: blank in it?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 17, 2016, 10:37pm UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/6 "2016-08-17T22:37:02Z")

</div>

If you overwrite the link kirbytag (i.e. copy and modify and then save it under the same name in `/site/tags`), I guess that should work and you would not run into problems when updating the core, not tested though.

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [August 18, 2016, 9:24am UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/7 "2016-08-18T09:24:44Z")

</div>

What Sonja wrote should work but please consider that it’s probably not the best thing to do to use target blank on everything. I’ve had good experience so far explaining to the client that it doesn’t always make sense.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 18, 2016, 9:59am UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/8 "2016-08-18T09:59:44Z")

</div>

You also might want to check out this post: [Open link in new tab button for non-coders](https://forum.getkirby.com/t/open-link-in-new-tab-button-for-non-coders/3151/15), there’s also a CSS-Tricks article on when to use or not to use `target: _blank`

---

<div class="post-metadata">

**Author:** ![josh.peterson](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/josh.peterson/32/2649_2.png) [@josh.peterson](https://forum.getkirby.com/u/josh.peterson)\
**Post date:** [August 18, 2016, 3:17pm UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/9 "2016-08-18T15:17:09Z")

</div>

Yeah, I think what I would do if I had time would be to write a plugin that  
adds a checkbox to the URL popup, asking if the link should open in a new  
window.

---

<div class="post-metadata">

**Author:** ![thguenther](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thguenther/32/16708_2.png) [@thguenther](https://forum.getkirby.com/u/thguenther)\
**Post date:** [August 18, 2016, 6:26pm UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/10 "2016-08-18T18:26:03Z")

</div>

That’s one feature of the [Kirby Enhanced Textarea](https://github.com/medienbaecker/kirby-enhanced-textarea)

![](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/d/dcdb9cb86199607c890adccb5b1e23ee6a979ee2.png)

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 4:55pm UTC](https://forum.getkirby.com/t/forcing-menu-link-to-open-in-a-new-window/3108/11 "2025-02-06T16:55:25Z")

</div>


