Search code examples
htmlmediawikimediawiki-templates

How to add custom/extra attributes to Mediawiki links?


I'm creating template on a personal wiki and I want some of the links to have custom attributes (e.g. rel, class, etc.).

Using HTML Syntax

I tried to put it as HTML code, but it's then escaped:

<a href="#{{{atelier-id|ex:atelier-id}}}" class="pilcrow">¶</a>
<a href="{{{auteur_url|ex:giroll.org/}}}" rel="author">{{{auteur|ex:auteur}}}</a>

Using Wiki Syntax

Then I tried using a wiki syntax, but still no good

[[#{{{atelier-id|ex:atelier-id}}}"|¶|pilcrow]]

Question

This seems trivial but I don't find any information on Help:Links page.

So how should I do to add extra attributes to my links ?


Solution

  • MediaWiki has no built in way to add link attributes, however there are at least two extensions that provide that functionality. You could try: