Template:PDFlink/doc

From Wikipedia, the free encyclopedia

This is the template documentation page for Template:PDFlink.

This page is not necessarily intended to be viewed directly. If it uses variables, some links may appear broken. Do not replace these variables with hardcoded page names or URLs.


Contents

[edit] Purpose

Highlighting that a link points to a PDF document (on some systems PDF files may take time to download and display within the browser, and their use on many websites is not compliant with the Web Content Accessibility Guidelines).

[edit] Usage

The following lines:

{{PDFlink|[http://www.example.org/Link.pdf Link]}}
{{PDFlink|[http://www.example.org/Link.pdf Link]|32 [[KiB]]}}

yield:

LinkPDF
LinkPDF (32 KiB)

Note: It was previously possible to add the icon with {{PDFlink}} by itself, but the functionality has been changed, making this no longer work in Internet Explorer. You must surround it with the template as shown above to work correctly in Internet Explorer.

[edit] Robot

PDFbot will come around once a month and attempt to add or update the filesize information for all instances of this template.

[edit] Limitations

As the template uses unnamed parameters, links containing = or | will cause the link to not display at all. The workarounds to this limitation are to replace the entity with an indirect character reference as = and |, respectively, or to use the numbered parameter (1= and 2=) for each parameter to take care of =, or to use Template:! to take care of |.

Examples:

  • {{PDFlink|[http://example.org/bla?a=xy|Link.pdf Link to a PDF]|32KB}}
  • {{PDFlink|[http://example.org/bla?a=xy|Link.pdf Link to a PDF]|32KB}}
  • {{PDFlink|1=[http://example.org/bla?a=xy{{!}}Link.pdf Link to a PDF]|2=32KB}}

[edit] See also