Extension:Attachments/ru
This extension is incompatible with MediaWiki 1.41 or any later release! You are advised against using this extension on a live site. MediaWiki developers are invited to pledge their efforts to updating this extension to make it compatible with MediaWiki 1.42 by replacing the {{Incompatible }} template with {{Incompatible |version=1.41|pledge=~~~~}} . |
Автор этого расширения больше не занимается его поддержкой! Хотя оно все еще может работать, любые сообщения об ошибках или запросы на совершенствовании, скорее всего, будут проигнорированы. |
Attachments Статус релиза: не поддерживается |
|
---|---|
Реализация | Функция парсера , Переменная , Действие страницы , Хук |
Описание | Attach subpages, files and external links to pages. |
Автор(ы) | (Gittenburgобсуждение) |
Последняя версия | 0.1.0 (2019-06-11) |
Политика совместимости | Мастер поддерживает обратную совместимость. |
MediaWiki | 1.32+ |
Лицензия | MIT License |
Скачать | GitHub: Note: |
Пример | https://vowi.fsinf.at/ |
|
|
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.
Advanced features
#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.
Установка
- Download и распакуйте файл(ы) в папку с названием
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;
Note that you should also enable subpages for these namespaces.
Optional configuration parameters
$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 .
|
Tips
- 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.
Credits
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.
- Extensions incompatible with 1.41/ru
- Unmaintained extensions/ru
- Parser function extensions/ru
- Variable extensions/ru
- Page action extensions/ru
- Hook extensions/ru
- MIT licensed extensions/ru
- Extensions in GitHub version control/ru
- ParserFirstCallInit extensions/ru
- BeforePageDisplay extensions/ru
- MagicWordwgVariableIDs extensions/ru
- ParserGetVariableValueSwitch extensions/ru
- SkinTemplateNavigation extensions/ru
- MinervaPreRender extensions/ru
- ListDefinedTags extensions/ru
- ChangeTagsListActive extensions/ru
- All extensions/ru
- Attachment extensions/ru