This page is a translated version of the page Extension:Attachments and the translation is 70% complete.
Other languages:
English • ‎Türkçe • ‎français • ‎svenska • ‎العربية • ‎日本語
Manual för MediaWikitillägg
OOjs UI icon advanced.svg
Utgivningsstatus: stabil
Genomförande Parserfunktion , Variabel , Sidhandling , Hake
Beskrivning Attach subpages, files and external links to pages.
Författare (Gittenburgdiskussion)
Senaste versionen 0.1.0 (2019-06-11)
Kompatibilitetsregler Master maintains backwards compatibility.
MediaWiki 1.32+
Licenser MIT-licens
Ladda ner
Exempel https://vowi.fsinf.at/

Kontrollera användning och versionsmatris.

The Attachments extension lets users attach subpages, files and external links to pages in enabled namespaces.

  • Attachments can easily be added through the user interface.
  • Attachments of an article are displayed in an automatically generated list at its end.
  • This extension integrates with the Vector and Minerva skins.

So how does it work?

  • subpages automatically count as attached to their parent page
  • When you upload a file through the Attach page action, a parser function {{#attach: Title}} is added to the descripiton.
  • When you add a link, the extension creates a subpage containing the {{#exturl: URL}} parser function.
  • Both parser functions set page properties, which are queried for the autogenerated sections.

Avancerade funktioner

  • #attach can also be used to attach a regular page to another regular page.
  • You can link files added through the Attach page action relatively with [[File:{{FILEPREFIX}}filename.jpg]] (or {{FILEPREFIX:..}} for the parent page).
  • You can exclude subpages starting with a specific prefix from the autoindex with {{#attachments ignore subpages: prefix}} on the parent page.
  • You can access attachments before they are sorted with the BeforeSortAttachments(&$links) hook, where links is an associative array mapping string keys to HTML links. Return false to take over the sorting.


  • Download och placera filen/filerna i en katalog som heter Attachments i din extensions/-mapp.
  • Lägg till följande kod längst ner i dina LocalSettings.php:
    wfLoadExtension( 'Attachments' );
  •   Klart – Ta dig till Special:Version på din wiki för att bekräfta att tillägget har installerats ordentligt.


Associative array, set a namespace id to true to enable the extension in the namespace.
For example: $wgAttachmentsNamespaces[NS_MAIN] = true;
Note that you should also enable subpages for these namespaces.


Tack till

This extension is essentially a complete rewrite of PerPageResources by Mathias Ertl, which consists of Extension:Resources, Extension:AddResource and Extension:ExternalRedirects. This extension replaces all three, notable differences are:

  • attachments are stored in page_props instead of pagelinks
  • no open redirects, just links
  • attachments are shown at the end of pages, as opposed to on a special page

Se även