[Mediawiki-l] wiki Markup to open a link in a new window

Rowan Collins rowan.collins at gmail.com
Mon Oct 17 14:31:26 UTC 2005


On 17/10/05, Peter Evans wrote:
> How to I open a link in a new window using wikimedia markup?

The short answer is that you can't. The longer answer is that this
comes up quite often on the mailing lists, and generally produces
reactions of "you shouldn't do it"; nonetheless, I think people have
hacked it in for their own use. One method involves editting the
function in includes/Linker.php (or Skin.php in older versions) which
produces the attributes added to external links (class="external" and
whatever) so that *all* extlinks open new windows. Try searching the
list archives (google with "site:mail.wikipedia.org") for more.

> Can I use the HTML to do this and place <nowiki> and </nowiki> around it
> to stop the wiki translation

No. There is a way of allowing the user to input raw HTML, but it's a
pretty dumb idea unless you are very sure who has access and trust
them all, because it would also allow them all sorts of unsafe
privileges (even just whitelisting the "<a>" tag and its "href"
attribute would allow "<a href='javascript:doSomethingNasty()'>"...)

PS Beware using "wikimedia" when you mean "MediaWiki", as the two are
very different things; see http://meta.wikimedia.org/wiki/Names

--
Rowan Collins BSc
[IMSoP]



More information about the MediaWiki-l mailing list