User:Wildgoosespeeder/MediaLink: Difference between revisions
From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
mNo edit summary |
m (Robot: Automated text replacement (-MediaLink +media-link)) |
||
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> | ||
{{DISPLAYTITLE:Template: | {{DISPLAYTITLE:Template:media-link}} | ||
{{PArchive|2|Archive 46#%7B% | {{PArchive|2|Archive 46#%7B%7Bmedia-link%7D%7D Template|<nowiki>{{media-link}}</nowiki> Template|Wildgoosespeeder|January 8|green}} | ||
==Usage== | ==Usage== | ||
Template idea for the prefix <code>Media:</code>. | Template idea for the prefix <code>Media:</code>. | ||
Line 31: | Line 31: | ||
===Use Cases=== | ===Use Cases=== | ||
{{tem| | {{tem|media-link}} testing for bugs: | ||
{| class="wikitable" | {| class="wikitable" | ||
! [[mediawiki.org:Main Page|MediaWiki]] parsing | ! [[mediawiki.org:Main Page|MediaWiki]] parsing | ||
Line 37: | Line 37: | ||
|- | |- | ||
! {{{{FULLPAGENAME}}|Alternate screen.png}} | ! {{{{FULLPAGENAME}}|Alternate screen.png}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media-link|Alternate screen.png}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}|Alternate screen.png|}} | ! {{{{FULLPAGENAME}}|Alternate screen.png|}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media-link|Alternate screen.png|}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}|Alternate screen.png|test}} | ! {{{{FULLPAGENAME}}|Alternate screen.png|test}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media-link|Alternate screen.png|test}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}||test}} | ! {{{{FULLPAGENAME}}||test}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media-link||test}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}||}} | ! {{{{FULLPAGENAME}}||}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media-link||}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}|}} | ! {{{{FULLPAGENAME}}|}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media-link|}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}} }} | ! {{{{FULLPAGENAME}} }} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media-link}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}|aeilsdfilasjdl.png}} | ! {{{{FULLPAGENAME}}|aeilsdfilasjdl.png}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media-link|aeilsdfilasjdl.png}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}|aeilsdfilasjdl.png|}} | ! {{{{FULLPAGENAME}}|aeilsdfilasjdl.png|}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media-link|aeilsdfilasjdl.png|}}</nowiki></code> | ||
|- | |- | ||
! {{{{FULLPAGENAME}}|aeilsdfilasjdl.png|test}} | ! {{{{FULLPAGENAME}}|aeilsdfilasjdl.png|test}} | ||
| <code><nowiki>{{ | | <code><nowiki>{{media-link|aeilsdfilasjdl.png|test}}</nowiki></code> | ||
|} | |} | ||
Revision as of 20:12, May 20, 2017
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:Alternate screen.png Media:aeilsdfilasjdl.png |
|||
:File:
|
File: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:Alternate screen.png | {{media-link|Alternate screen.png}}
|
File:Alternate screen.png | {{media-link|Alternate screen.png|}}
|
test | {{media-link|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.