Template:Media link
Jump to navigation
Jump to search
Usage[edit source]
Template idea for the prefix Media:.
Media: vs. :File:[edit source]
Both prefixes display a link instead of embedding the image itself but there are some key differences:
| Prefix | Sample | Special:UnusedFiles prevention | Provides a file page link | Provides a special link to Special:Upload if a red link has been detected |
|---|---|---|---|---|
Media:
|
Media:Example.png Media:Placeholder.png |
|||
:File:
|
File:Example.png File:Placeholder.png |
That's what this template addresses by bring the best of both worlds together. This template should be used in main articles only!
Use cases[edit source]
{{media link}} testing for bugs:
| MediaWiki parsing | Code |
|---|---|
| File:Example.png | {{media link|Example.png}}
|
| File:Example.png | {{media link|Example.png|}}
|
| test | {{media link|Example.png|test}}
|
| [[Media:|test]] | {{media link||test}}
|
| [[Media:|File:]] | {{media link||}}
|
| [[Media:|File:]] | {{media link|}}
|
| [[Media:{{{1}}}|File:{{{1}}}]] | {{media link}}
|
| File:Placeholder.png | {{media link|Placeholder.png}}
|
| File:Placeholder.png | {{media link|Placeholder.png|}}
|
| test | {{media link|Placeholder.png|test}}
|
Other[edit source]
Uses {{!}}. Also hides media prefix usage with <span> tag and a simple CSS code. Special code implemented if a red link results from the file string specified.