All externals links on my pages open in a new tab

Hello,

I have define my own theme that is inheriting from quark theme.

I would like to know own can I make all externals links on my pages open in a new tab of the navigator. I don’t want to write target="_blank" for each link, I don’t know if it’s possible.

This links are in pages using markdown or html.

Thank you

Hi @thgr, have you seen this External Links Plugin? I use it quite a bit for this exact purpose.

thank you ! that’s it !

1 Like

Good morning all, I hope are all safe and well.

it is possible to open the external link as a new tab?

---
title: 'Title'
external_url: 'https://www.getgrav.org'?_blank
---

I tried different options, but none of them successful.

thanks in advance
Carlos.

Your link isn’t going to work for a couple of reasons. You have closed the quote in the middle of the URL. You don’t even need the quotes here. Also, you want your HTML to be <a href="https://www.getgrav.org" target="_blank">...</a>, which needs to come from a Twig template. I think you are getting confused with Grav flavoured Markdown, which offers that shortcut notation.

Are you asking if you can force a new tab rather than a window? No, that level of control isn’t offered by browsers to websites. Browsers and user settings determine the behaviour of _blank links.