امتداد:مرفقات
![]() حالة الإصدار مستقر |
|
---|---|
![]() |
|
تنفيذ | دوال المحلل اللغوي , متغير , تصرف خاصة بالصفحة , وصلة |
بيان | إرفاق صفحات فرعية وملفات ووصلات شبكية خارجية في الصفحات. |
المؤلف/المؤلفون | (Gittenburgنقاش) |
آخر إصدار | 0.1.0 (2019-06-11) |
سياسة التوافق | النسخة الرئيسية تحافظ على التوافق مع الإصدارات السابقة. |
MediaWiki | 1.32+ |
ترخيص | رخصة MIT |
التنزيل | GitHub: ملحوظة: |
مثال | https://vowi.fsinf.at/ |
|
|
يسمح امتداد Attachments للمستخدمين إرفاق صفحات فرعية وملفات ووصلات شبكية خارجية في الصفحات قائمة في نطاقات الاسم المنشطة.
- 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.
سمات متقدمة
#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.
التنصيب
- تنزيل وضع الملف/الملفات في دليل يحمل اسم
Attachments
في مجلد extensions/
لديك. - أضف الكود التالي في الجزء الأسفل من ملف
LocalSettings.php
:wfLoadExtension( 'Attachments' );
- تم التنفيذ – اذهب إلى Special:Version على موقع الويكي لديك كي تتحقق من أن الامتداد قد ثبت بنجاح.
You will need to enable the extension for the namespaces where you want to use it, e.g:
$wgAttachmentsNamespaces[NS_MAIN] = true;
لاحظ أنه يمكنك أيضًا تمكين الصفحات الفرعية لنطاقات الاسم هذه.
متغيرات ضبط اختيارية
$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 .
|
نصائح
- Enable $wgCountCategorizedImagesAsUsed to exclude attached files from Special:UnusedImages.
- Attachments and external URLs are both stored as page props, meaning they can be queried with API:Pageprops and API:Pageswithprop.
- Set $wgForeignUploadTargets to
[]
, if you want to prevent users from circumventing this extension through the upload dialog. - If new attachments do not show up, it might be because you have many jobs in your job queue.
شكر وتقدير
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
انظر أيضا
- MoinMoinWiki - supports attachments out of the box.
- Extension:PageAttachment - unmaintained, has 7k lines of PHP – this extension has about 400
- Extension:FileAttach - unmaintained, saves attachments in wikitext