Extension:Attachments

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:Attachments and the translation is 100% complete.
MediaWiki manüel uzantıları
OOjs UI icon advanced-invert.svg
Attachments
Sürüm durumu: kararlı
px
Uygulama Ayrıştırıcı işlevi , Değişken , Sayfa işlemi , Kanca
Açıklama Sayfalara alt sayfalar, dosyalar ve harici bağlantılar ekleyin.
Yazar(lar) (Gittenburgmesaj)
En son sürüm 0.1.0 (2019-06-11)
Uyumluluk politikası Master, geriye dönük uyumluluğu korur.
MediaWiki 1.32+
Lisans MIT Lisansı
İndir
Örnek https://vowi.fsinf.at/

  • $wgAttachmentsNamespaces
  • $wgAttachmentsChunkListByLetter
  • $wgAttachmentsShowSubpageForm
  • $wgAttachmentsShowLinkForm

Kullanım ve sürüm matrisini kontrol edin.

Attachments uzantısı, kullanıcıların etkin ad alanlarındaki sayfalara alt sayfalar, dosyalar ve harici bağlantılar eklemelerine olanak tanır.

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

Gelişmiş özelliker

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

Kurulum

  • Dosyaları İndir ve extensions/ klasörünüzdeki Attachments adlı dizine yerleştirin.
  • LocalSettings.php dosyanızın altına aşağıdaki kodu ekleyin:
    wfLoadExtension( 'Attachments' );
    
  • Yes Yapıldı – Uzantının başarıyla yüklendiğini doğrulamak için vikinizde Special:Version seçeneğine gidin.

You will need to enable the extension for the namespaces where you want to use it, e.g:

$wgAttachmentsNamespaces[NS_MAIN] = true;

Note that you should also enable subpages for these namespaces.

isteğe bağlı yapılandırma parametreleri

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

İpuçlar

Katkıda bulunanlar

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

Ayrıca bakınız