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===
*{{{{FULLPAGENAME}}|Alternate screen.png}} <code><nowiki>{{User:Wildgoosespeeder/MediaLink|Alternate screen.png}}</nowiki></code>
{{tem|MediaLink}} testing for bugs:
*{{{{FULLPAGENAME}}|Alternate screen.png|}} <code><nowiki>{{User:Wildgoosespeeder/MediaLink|Alternate screen.png|}}</nowiki></code>
{| class="wikitable"
*{{{{FULLPAGENAME}}||test}} <code><nowiki>{{User:Wildgoosespeeder/MediaLink||test}}</nowiki></code>
! [[mediawiki.org:Main Page|MediaWiki]] parsing
*{{{{FULLPAGENAME}}|Alternate screen.png|test}} <code><nowiki>{{User:Wildgoosespeeder/MediaLink|Alternate screen.png|test}}</nowiki></code>
! 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 Check mark.svg X mark.svg
:File: File:Alternate screen.png X mark.svg Check mark.svg

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.pngMedia:Alternate screen.png {{MediaLink|Alternate screen.png}}
File:Alternate screen.pngMedia:Alternate screen.png {{MediaLink|Alternate screen.png|}}
[[:File:|test]][[Media:]] {{MediaLink||test}}
testMedia:Alternate screen.png {{MediaLink|Alternate screen.png|test}}

Other

Uses {{!}}. Also hides media prefix usage with <span> tag and a simple CSS code.