Extension:Attachments/sv

Category:MIT licensed extensions/sv
Manual för MediaWikitillägg
Attachments
Utgivningsstatus: stabilCategory:Stable extensions/sv
Genomförande Parserfunktion Category:Parser function extensions/sv, Variabel Category:Variable extensions/sv, Sidhandling Category:Page action extensions/sv, Hake Category:Hook extensions/sv
Beskrivning Fäst undersidor, filer och externa länkar på sidor.
Författare
Senaste versionen 1.0.1
Kompatibilitetsregler Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.39+Category:Extensions with manual MediaWiki version
Licenser MIT-licens
Ladda ner Category:Extensions in GitHub version control/sv
Exempel https://vowi.fsinf.at/
  • $wgAttachmentsNamespaces
  • $wgAttachmentsChunkListByLetter
  • $wgAttachmentsShowSubpageForm
  • $wgAttachmentsShowLinkForm
  • $wgAttachmentsShowInNamespaces
  • $wgAttachmentsShowInViews
  • $wgAttachmentsShowEmptySection
Category:All extensions/sv

Tillägget Attachments låter användare fästa undersidor, filer och externa länkar på sidor i utvalda namnrymder.

  • 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 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.

Relatively linking an attached file

The Attachments extension provides the {{FILEPREFIX}} parser function to faciliate linking/embedding attached files.

If you attach an image Example.jpg to Somepage then you can embed the image:

  • from Somepage with [[File:{{FILEPREFIX}}Example.jpg]]
  • from Somepage/Subpage with [[File:{{FILEPREFIX:..}}Example.jpg]]
  • from Somepage/Subpage/Subsubpage with [[File:{{FILEPREFIX:../..}}Example.jpg]]

Note that the same also works with [[Media:...]] links.

Installation

  • Enable Uploads.
  • Developers can clone the extension into your MediaWiki extensions directory:
    cd extensions/
    git clone https://github.com/vuhuy/Swiki
    
  • Observera att du också borde aktivera undersidor för dessa namnrymder.

Valfria konfigurationsparametrar

$wgAttachmentsChunkListByLetter Boolean Whether or not the attachment list should be chunked by the first letter of list items. Defaults to true.
$wgAttachmentsShowSubpageForm Boolean Whether or not the subpage form should be shown. Defaults to true.
$wgAttachmentsShowLinkForm Boolean Whether or not the external link form should be shown. Defaults to true.
$wgAttachmentsShowInNamespaces Boolean Whether or not a link to the attachments should be shown in the namespaces (page, discussion). Defaults to false.
$wgAttachmentsShowInViews Boolean Whether or not an 'add attachments' link should be shown in the views (read, edit source, view history). Defaults to false.
$wgAttachmentsShowEmptySection Boolean Whether or not to show certain elements when there are no attachments for a page. Defaults to false.

Tips

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

Originally developed and maintained by Gittenburg.

Se även

Category:Attachment extensions/sv
Category:All extensions/sv Category:Attachment extensions/sv Category:BeforePageDisplay extensions/sv Category:ChangeTagsListActive extensions/sv Category:Extensions in GitHub version control/sv Category:Extensions with manual MediaWiki version Category:Hook extensions/sv Category:ListDefinedTags extensions/sv Category:MIT licensed extensions/sv Category:MagicWordwgVariableIDs extensions/sv Category:Page action extensions/sv Category:ParserFirstCallInit extensions/sv Category:ParserGetVariableValueSwitch extensions/sv Category:Parser function extensions/sv Category:SkinTemplateNavigation::Universal extensions/sv Category:Stable extensions/sv Category:Variable extensions/sv