User:Wildgoosespeeder/MediaLink: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
mNo edit summary
m (More documentation.)
Line 12: Line 12:
! [[Special:UnusedFiles]] prevention
! [[Special:UnusedFiles]] prevention
! Provides a file page link
! Provides a file page link
! Provides a special link to [[Special:Upload]] if [[red link]] is detected
|-
|-
! <code>Media:</code>
! <code>Media:</code>
| [[Media:Alternate screen.png]]
| [[Media: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]]
| [[File:Check mark.svg|25px]]
|-
|-
! <code>:File:</code>
! <code>:File:</code>
| [[:File:Alternate screen.png]]
| [[:File: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]]
| [[File:X mark.svg|25px]]
|}
|}



Revision as of 18:07, 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 Provides a special link to Special:Upload if red link is detected
Media: Media:Alternate screen.png
Media:aeilsdfilasjdl.png
Check mark.svg X mark.svg Check mark.svg
:File: File:Alternate screen.png
File:aeilsdfilasjdl.png
X mark.svg Check mark.svg X 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.png {{MediaLink|Alternate screen.png}}
File:Alternate screen.png {{MediaLink|Alternate screen.png|}}
test {{MediaLink|Alternate screen.png|test}}
[[Media:|test]] {{MediaLink||test}}
File:aeilsdfilasjdl.png {{MediaLink|aeilsdfilasjdl.png}}
File:aeilsdfilasjdl.png {{MediaLink|aeilsdfilasjdl.png|}}
test {{MediaLink|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.