Extension:Link Attributes/sv

Varning Varning: This extension is often confused with the similarly named Extension:LinkAttributes.
Category:GPL licensed extensions/sv
Manual för MediaWikitillägg
Link Attributes
Utgivningsstatus: stabilCategory:Stable extensions/sv
Genomförande Parserfunktion Category:Parser function extensions/sv
Beskrivning Adds support for the rel, rev and class attributes on links
Författare Toby Inkster, Dennis Roczek, Sam Wilson
Senaste versionen 1.1
MediaWiki >= 1.35.0
Förändringar i databasen Nej
Licenser GNU General Public License 2.0 eller senare
Ladda ner Category:Extensions in Wikimedia version control/sv
Översätt tillägget Link Attributes om det finns tillgängligt på translatewiki.net
Category:All extensions/sv

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

  • Ladda ner och placera filen/filerna i en katalog som heter Link_Attributes i din extensions/-mapp.
    Utvecklare och personer som bidrar med kod borde istället installera tillägget från Git, med:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Link_Attributes
    
  • Lägg till följande kod längst ner i din LocalSettings.php -fil:
    wfLoadExtension( 'Link_Attributes' );
    
  • Yes Klart – Ta dig till Special:Version på din wiki för att bekräfta att tillägget har installerats ordentligt.

Se även

Category:All extensions/sv Category:Extensions in Wikimedia version control/sv Category:GPL licensed extensions/sv Category:HtmlPageLinkRendererEnd extensions/sv Category:LinkerMakeExternalLink extensions/sv Category:Parser function extensions/sv Category:Stable extensions/sv