Template:Media link: Difference between revisions
From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
(Proposal passed.) |
mNo edit summary |
||
(15 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{#ifexist:File:{{{1}}}|[[:File:{{{1}}}{{#if:{{{2|}}}|{{!}}{{{2}}}}}]]<span style="display:none | <includeonly>{{#ifexist:File:{{{1}}}|[[:File:{{{1}}}{{#if:{{{2|}}}|{{!}}{{{2}}}}}]]<span style="display:none">}}[[Media:{{{1}}}{{#ifexist:File:{{{1}}}||{{!}}{{#if:{{{2|}}}|{{{2}}}|File:{{{1}}}}}}}]]{{#ifexist:File:{{{1}}}|</span>}}</includeonly><noinclude> | ||
==Usage== | == Usage == | ||
Template idea for the prefix <code>Media:</code>. | Template idea for the prefix <code>Media:</code>. | ||
===Media: vs. :File:=== | === Media: vs. :File: === | ||
Both prefixes display a link instead of embedding the image itself but there are some key differences: | Both prefixes display a link instead of embedding the image itself but there are some key differences: | ||
Line 11: | Line 11: | ||
! [[Special:UnusedFiles]] prevention | ! [[Special:UnusedFiles]] prevention | ||
! Provides a file page link | ! Provides a file page link | ||
! Provides a special link to [[Special:Upload]] if [[red link]] | ! Provides a special link to [[Special:Upload]] if a [[red link]] has been detected | ||
|- | |- | ||
! <code>Media:</code> | ! <code>Media:</code> | ||
| [[Media:Alternate | | [[Media:MK8 Electrodrome Alternate Screen.png]]<br>[[Media:aeilsdfilasjdl.png]] | ||
| [[File:Check mark.svg|25px]] | | [[File:Check mark.svg|25px]] | ||
| [[File:X mark.svg|25px]] | | [[File:X mark.svg|25px]] | ||
Line 20: | Line 20: | ||
|- | |- | ||
! <code>:File:</code> | ! <code>:File:</code> | ||
| [[:File:Alternate | | [[:File:MK8 Electrodrome Alternate Screen.png]]<br>[[:File:aeilsdfilasjdl.png]] | ||
| [[File:X mark.svg|25px]] | | [[File:X mark.svg|25px]] | ||
| [[File:Check mark.svg|25px]] | | [[File:Check mark.svg|25px]] | ||
Line 26: | Line 26: | ||
|} | |} | ||
This template addresses these differences by bringing the best of both worlds together. Please note that this template should be used in '''main articles only'''. | |||
===Use | === Use cases === | ||
{{tem| | {{tem|media link}} testing for bugs: | ||
{| class="wikitable" | {| class="wikitable" | ||
! [[ | ! [[mw:Main Page|MediaWiki]] parsing | ||
! Code | ! Code | ||
|- | |- | ||
! {{{{PAGENAME}}|Alternate | ! {{{{PAGENAME}}|MK8 Electrodrome Alternate Screen.png}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media link|MK8 Electrodrome Alternate Screen.png}}</nowiki></code> | ||
|- | |- | ||
! {{{{PAGENAME}}|Alternate | ! {{{{PAGENAME}}|MK8 Electrodrome Alternate Screen.png|}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media link|MK8 Electrodrome Alternate Screen.png|}}</nowiki></code> | ||
|- | |- | ||
! {{{{PAGENAME}}|Alternate | ! {{{{PAGENAME}}|MK8 Electrodrome Alternate Screen.png|test}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media link|MK8 Electrodrome Alternate Screen.png|test}}</nowiki></code> | ||
|- | |- | ||
! {{{{PAGENAME}}||test}} | ! {{{{PAGENAME}}||test}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media link||test}}</nowiki></code> | ||
|- | |- | ||
! {{{{PAGENAME}}||}} | ! {{{{PAGENAME}}||}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media link||}}</nowiki></code> | ||
|- | |- | ||
! {{{{PAGENAME}}|}} | ! {{{{PAGENAME}}|}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media link|}}</nowiki></code> | ||
|- | |- | ||
! {{{{PAGENAME}} }} | ! {{{{PAGENAME}} }} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media link}}</nowiki></code> | ||
|- | |- | ||
! {{{{PAGENAME}}|aeilsdfilasjdl.png}} | ! {{{{PAGENAME}}|aeilsdfilasjdl.png}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media link|aeilsdfilasjdl.png}}</nowiki></code> | ||
|- | |- | ||
! {{{{PAGENAME}}|aeilsdfilasjdl.png|}} | ! {{{{PAGENAME}}|aeilsdfilasjdl.png|}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media link|aeilsdfilasjdl.png|}}</nowiki></code> | ||
|- | |- | ||
! {{{{PAGENAME}}|aeilsdfilasjdl.png|test}} | ! {{{{PAGENAME}}|aeilsdfilasjdl.png|test}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media link|aeilsdfilasjdl.png|test}}</nowiki></code> | ||
|} | |} | ||
===Other=== | === Other === | ||
Uses <code>{{ | Uses <code><nowiki>{{!}}</nowiki></code>. Also hides media prefix usage with <nowiki><span></nowiki> tag and a simple CSS code. Special code implemented if a red link results from the file string specified. | ||
</noinclude> | |||
[[Category:Formatting templates]] | |||
[[Category:Media templates]]</noinclude> |
Latest revision as of 10:47, March 24, 2024
Usage
Template idea for the prefix Media:
.
Media: vs. :File:
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:MK8 Electrodrome Alternate Screen.png Media:aeilsdfilasjdl.png |
|||
:File:
|
File:MK8 Electrodrome Alternate Screen.png File:aeilsdfilasjdl.png |
This template addresses these differences by bringing the best of both worlds together. Please note that this template should be used in main articles only.
Use cases
{{media link}} testing for bugs:
MediaWiki parsing | Code |
---|---|
File:MK8 Electrodrome Alternate Screen.png | {{media link|MK8 Electrodrome Alternate Screen.png}}
|
File:MK8 Electrodrome Alternate Screen.png | {{media link|MK8 Electrodrome Alternate Screen.png|}}
|
test | {{media link|MK8 Electrodrome Alternate Screen.png|test}}
|
[[Media:|test]] | {{media link||test}}
|
[[Media:|File:]] | {{media link||}}
|
[[Media:|File:]] | {{media link|}}
|
[[Media:{{{1}}}|File:{{{1}}}]] | {{media link}}
|
File:aeilsdfilasjdl.png | {{media link|aeilsdfilasjdl.png}}
|
File:aeilsdfilasjdl.png | {{media link|aeilsdfilasjdl.png|}}
|
test | {{media link|aeilsdfilasjdl.png|test}}
|
Other
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.