Template:Download PDF
Appearance
This template is a template gadget. It requires the DownloadPDF gadget to work, which is loaded automatically when this template is used. |
Use this template to make a button that, when clicked, will prompt the user to print or download a PDF with a specified set of pages.
See the installation instructions to get it working in your wiki.
Usage
[edit]Markup | Renders as |
---|---|
{{Download PDF | pages = Help:Images, Help:Tables, Help:Templates | text = Download help pages }} |
|
Installation
[edit]To install this template in your wiki:
- Create a template with the following markup. You can choose the template name, parameter names and defaults to suit your wiki.
<includeonly><span data-pages="{{{pages|{{FULLPAGENAME}}}}}" data-separator="{{{separator|,}}}" class="DownloadPDF cdx-button cdx-button--fake-button cdx-button--fake-button--enabled" tabindex="0" role="button">{{{text|Download PDF}}}</span>[[Category:Gadget:DownloadPDF]]</includeonly>
- Create MediaWiki:Gadget-DownloadPDF.js with the following code:
/** * DownloadPDF enables printing or downloading a specified set of pages * Documentation: https://www.mediawiki.org/wiki/DownloadPDF * Source code: https://www.mediawiki.org/wiki/MediaWiki:Gadget-Global-DownloadPDF.js */ mw.loader.load( '//www.mediawiki.org/w/load.php?modules=ext.gadget.Global-DownloadPDF' );
- Add the following gadget to MediaWiki:Gadgets-definition:
* DownloadPDF[ResourceLoader|hidden|default|categories=Gadget:DownloadPDF]|DownloadPDF.js
Done! Add your template to any page to verify that the installation was successful.
Template data
[edit]Use this template to make a button that, when clicked, will prompt the user to print or download a PDF with a specified set of pages.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Pages | pages | Comma-separated list of pages to print or download
| String | optional |
Separator | separator | Separator in the list of pages
| String | optional |
Text | text | Text of the button
| String | optional |
See also
[edit]- v:Template:Download PDF - Localization of this template for the English Wikiversity