Link target black when opening an URL

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Link target black when opening an URL

Bowen Yu
Hi, 

I am not sure if this is right place to post this question. It's about link target black. I insert a hyper link in the wikicode. When people click it, I want it to be popped out in another new window. Anyone knows how it could work out? Thanks!

Here is how the wikicode looks like now:
[https://website..  hyper_link]

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Link target black when opening an URL

Bartosz Dziewoński
It's actually "blank", not black :)

If you want all external links on your wiki to do that, you can set $wgExternalLinkTarget = '_blank'; in your LocalSettings.php file. It is not possible to change this for individual links.

W dniu piątek, 11 sierpnia 2017 Bowen Yu <[hidden email]> napisał(a):
Hi, 

I am not sure if this is right place to post this question. It's about link target black. I insert a hyper link in the wikicode. When people click it, I want it to be popped out in another new window. Anyone knows how it could work out? Thanks!

Here is how the wikicode looks like now:
[https://website..  hyper_link]


--
Matma Rex

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Link target black when opening an URL

Bowen Yu
Ha, sorry about the typo :)

Yeh, I was hoping I can make it happen to individual links, as I will be sending survey link in the message to some editors. That's unfortunate. Thanks for your reply!

On Fri, Aug 11, 2017 at 12:16 PM, Bartosz Dziewoński <[hidden email]> wrote:
It's actually "blank", not black :)

If you want all external links on your wiki to do that, you can set $wgExternalLinkTarget = '_blank'; in your LocalSettings.php file. It is not possible to change this for individual links.


W dniu piątek, 11 sierpnia 2017 Bowen Yu <[hidden email]> napisał(a):
Hi, 

I am not sure if this is right place to post this question. It's about link target black. I insert a hyper link in the wikicode. When people click it, I want it to be popped out in another new window. Anyone knows how it could work out? Thanks!

Here is how the wikicode looks like now:
[https://website..  hyper_link]


--
Matma Rex

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api



_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Link target black when opening an URL

Gergo Tisza
On Fri, Aug 11, 2017 at 8:38 PM, Bowen Yu <[hidden email]> wrote:
Yeh, I was hoping I can make it happen to individual links, as I will be sending survey link in the message to some editors. That's unfortunate. Thanks for your reply!

There are various extensions that allow you to use raw HTML in a wiki page, so you can just write <a href="/wiki/..." target="_blank">...</a>. (The security implications should be carefully assessed though.)
Alternatively, if it's OK for the link to only pop up in Javascript-enabled browsers, you can wrap the wikilink in a span with a specific class and have a script run on page load and change the target attribute of links inside that class.

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api