User:Wildgoosespeeder/MediaLink: Difference between revisions
From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>[[:File:{{{1}}}{{#if:{{{2|}}}|{{!}}{{{2}}}}}]]<span style="display:none;">[[Media:{{{1}}}]]</span></includeonly><noinclude> | <includeonly>[[:File:{{{1}}}{{#if:{{{2|}}}|{{!}}{{{2}}}}}]]<span style="display:none;">[[Media:{{{1}}}]]</span></includeonly><noinclude> | ||
{{DISPLAYTITLE:Template:MediaLink}} | |||
==Usage== | ==Usage== | ||
Template idea for the prefix "Media:" | Template idea for the prefix "Media:" | ||
Line 26: | Line 27: | ||
===Use Cases=== | ===Use Cases=== | ||
{{tem|MediaLink}} testing for bugs: | |||
{| class="wikitable" | |||
! [[mediawiki.org:Main Page|MediaWiki]] parsing | |||
! Code | |||
|- | |||
! {{{{FULLPAGENAME}}|Alternate screen.png}} | |||
| <code><nowiki>{{MediaLink|Alternate screen.png}}</nowiki></code> | |||
|- | |||
! {{{{FULLPAGENAME}}|Alternate screen.png|}} | |||
| <code><nowiki>{{MediaLink|Alternate screen.png|}}</nowiki></code> | |||
|- | |||
! {{{{FULLPAGENAME}}||test}} | |||
| <code><nowiki>{{MediaLink||test}}</nowiki></code> | |||
|- | |||
! {{{{FULLPAGENAME}}|Alternate screen.png|test}} | |||
| <code><nowiki>{{MediaLink|Alternate screen.png|test}}</nowiki></code> | |||
|} | |||
===Other=== | ===Other=== | ||
Uses <code>{{tem|!}}</code>. | Uses <code>{{tem|!}}</code>. Also hides media prefix usage with <nowiki><span></nowiki> tag and a simple CSS code. | ||
</noinclude> | </noinclude> |
Revision as of 16:22, January 1, 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 |
---|---|---|---|
Media:
|
Media:Alternate screen.png | ||
:File:
|
File:Alternate screen.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
{{MediaLink}} testing for bugs:
MediaWiki parsing | Code |
---|---|
File:Alternate screen.png | {{MediaLink|Alternate screen.png}}
|
File:Alternate screen.png | {{MediaLink|Alternate screen.png|}}
|
[[:File:|test]] | {{MediaLink||test}}
|
test | {{MediaLink|Alternate screen.png|test}}
|
Other
Uses {{!}}
. Also hides media prefix usage with <span> tag and a simple CSS code.