Extension:Link Attributes/sv

From Linux Web Expert

File:OOjs UI icon notice-destructive.svg <translate> Warning:</translate> This extension is often confused with the similarly named Extension:LinkAttributes.
Manual för MediaWikitillägg
Link Attributes
Utgivningsstatus: stabil
Genomförande Parserfunktion
Beskrivning Adds support for the rel, rev and class attributes on links
Författare Toby Inkster, Dennis Roczek, Sam Wilson
MediaWiki
Förändringar i databasen Nej
Licenser Ingen angiven licens
Ladda ner
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Översätt tillägget Link Attributes om det finns tillgängligt på translatewiki.net

This extension adds support for the rel, rev and class attributes on external links:

  • relThe relationship of the linked URL as space-separated link types.
  • revSpecified a reverse link; the opposite of the rel attribute. Deprecated for being very confusing.
  • class – A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements.

Användning

The syntax is a little unorthodox. To set the rel attribute, place one or more tokens in double-parentheses at the end of the link title. e.g.:

  [http://tobyinkster.co.uk/ My website((me home))]

The above would be converted to the following link:

  <a href="http://tobyinkster.co.uk/" rel="me home" class="external">My website</a>

To set the class attribute, the same syntax is used, but tokens which represent classes are prefixed with a dot:

  [http://tobyinkster.co.uk/ My website((me .class1 home .class2))]

Becomes:

  <a href="http://tobyinkster.co.uk/" rel="me home" class="external class1 class2">My website</a>

Similarly, prefixing with a tilde (~) sets the rev attribute.

Tokens may be prefixed by a minus sign (-) to indicate that you don't want to add the token, but remove it. For example:

  [http://tobyinkster.co.uk/ My website((me -.external home))]

Becomes:

  <a href="http://tobyinkster.co.uk/" rel="me home">My website</a>

The "nofollow" rel token is considered untouchable though.

Installation

  • <translate> [[<tvar name=2>Special:ExtensionDistributor/Link_Attributes</tvar>|Download]] and move the extracted <tvar name=name>Link_Attributes</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Link_Attributes
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'Link_Attributes' );
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Se även

  • Extension:LinkAttributes – en annan syntax för att lägga till attribut.
  • T35886