User:Wildgoosespeeder/MediaLink: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
No edit summary
mNo edit summary
Line 40: Line 40:
! {{{{FULLPAGENAME}}||test}}
! {{{{FULLPAGENAME}}||test}}
| <code><nowiki>{{MediaLink||test}}</nowiki></code>
| <code><nowiki>{{MediaLink||test}}</nowiki></code>
|-
! {{{{FULLPAGENAME}}||}}
| <code><nowiki>{{MediaLink||}}</nowiki></code>
|-
! {{{{FULLPAGENAME}}|}}
| <code><nowiki>{{MediaLink|}}</nowiki></code>
|-
! {{{{FULLPAGENAME}} }}
| <code><nowiki>{{MediaLink}}</nowiki></code>
|-
|-
! {{{{FULLPAGENAME}}|Alternate screen.png|test}}
! {{{{FULLPAGENAME}}|Alternate screen.png|test}}

Revision as of 17:18, January 2, 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}}
[[:File:]][[Media:]] {{MediaLink||}}
[[:File:]][[Media:]] {{MediaLink|}}
[[:File:{{{1}}}]][[Media:{{{1}}}]] {{MediaLink}}
testMedia:Alternate screen.png {{MediaLink|Alternate screen.png|test}}

Other

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