User:Wildgoosespeeder/MediaLink: Difference between revisions
From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
m (Text replacement - "(mediawiki\.org|MediaWiki\.org|Mediawiki\.org|Mediawiki\.Org|MediaWiki\.Org|MEDIAWIKI\.ORG|mediaWiki\.org|mediaWiki\.Org):" to "mww:") |
m (maintenance) |
||
Line 1: | Line 1: | ||
<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> | <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> | ||
{{User:Wildgoosespeeder/AlertForUsers}} | |||
{{DISPLAYTITLE:Template:media link}} | {{DISPLAYTITLE:Template:media link}} | ||
{{PArchive|2|Archive 46#%7B%7Bmedia link%7D%7D Template|<nowiki>{{media link}}</nowiki> Template|Wildgoosespeeder|January 8|green}} | {{PArchive|2|Archive 46#%7B%7Bmedia link%7D%7D Template|<nowiki>{{media link}}</nowiki> Template|Wildgoosespeeder|January 8|green}} | ||
Line 16: | Line 17: | ||
|- | |- | ||
! <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 22: | Line 23: | ||
|- | |- | ||
! <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 36: | Line 37: | ||
! Code | ! Code | ||
|- | |- | ||
! {{{{FULLPAGENAME}}|Alternate | ! {{{{FULLPAGENAME}}|MK8 Electrodrome Alternate Screen.png}} | ||
| <code><nowiki>{{media link|Alternate | | <code><nowiki>{{media link|MK8 Electrodrome Alternate Screen.png}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}|Alternate | ! {{{{FULLPAGENAME}}|MK8 Electrodrome Alternate Screen.png|}} | ||
| <code><nowiki>{{media link|Alternate | | <code><nowiki>{{media link|MK8 Electrodrome Alternate Screen.png|}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}|Alternate | ! {{{{FULLPAGENAME}}|MK8 Electrodrome Alternate Screen.png|test}} | ||
| <code><nowiki>{{media link|Alternate | | <code><nowiki>{{media link|MK8 Electrodrome Alternate Screen.png|test}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}||test}} | ! {{{{FULLPAGENAME}}||test}} |
Revision as of 12:23, December 14, 2021
ATTENTION EDITORS If you are moving files that this page links to, you have my permission to ask a sysop to change the link. If you are replacing images that this page links to instead, please leave me a message to give me a heads-up. Thank you! Wildgoosespeeder (talk) (Stats - Contribs) |
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 red link is detected |
---|---|---|---|---|
Media:
|
Media:MK8 Electrodrome Alternate Screen.png Media:aeilsdfilasjdl.png |
|||
:File:
|
File:MK8 Electrodrome Alternate Screen.png File:aeilsdfilasjdl.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
{{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.