Actions

Template

Difference between revisions of "Imagetag"

From Sonic Retro

(hopefully a bit neater)
Line 1: Line 1:
{| class="toc" align="{{#if:{{{align|}}}|{{{align}}}|center}}" style="padding: 0 1em;"
+
{| class="prettytable" align="{{#if:{{{align|}}}|{{{align}}}|center}}" style="padding:0px;"
|{{ #if: {{{image|}}} | [[Image:{{{image}}}|center|link={{{imagelink|}}}|{{{imagewidth|}}}]] | {{#ifeq:{{NAMESPACE}}|{{ns:Template}}|[[Category:Image templates lacking an icon|{{PAGENAME}}]]|}} }}
+
!style="width:80px; text-align:center;"| {{ #if: {{{image|}}} | [[File:{{{image}}}|center|link={{{imagelink|}}}|{{#if:{{{imagewidth|}}}|{{{imagewidth|}}}|64x64}}px]] | {{#ifeq:{{NAMESPACE}}|{{ns:Template}}|[[Category:Image templates lacking an icon|{{PAGENAME}}]]|}} }}
| width="{{{textwidth|}}}" | {{ #if: {{{text|}}} | {{{text}}} | This is an image. }}
+
|style="padding:4px;"| {{ #if: {{{text|}}} | {{{text}}} | This is an image. }}
|}{{BadNameCheck|{{PAGENAME}}}}<noinclude>{{Imagetag|image=Sonic Retro emblem.svg|imagewidth=128|text=Ceci n'est pas un rétro.}}
+
|}{{BadNameCheck|{{PAGENAME}}}}<noinclude>{{Imagetag|image=Sonic Retro emblem.svg|imagewidth=32|text=Ceci n'est pas un rétro.}}
 
This template is for anything that needs to be in a box styled as Sonic Retro itself is styled; it should be used instead of [[:Template:Box|Box]] or a <tt><nowiki><div></nowiki></tt> tag unless necessary. It was originally created (and thus was named) for transclusion in [[:Category:Image templates|image templates]].
 
This template is for anything that needs to be in a box styled as Sonic Retro itself is styled; it should be used instead of [[:Template:Box|Box]] or a <tt><nowiki><div></nowiki></tt> tag unless necessary. It was originally created (and thus was named) for transclusion in [[:Category:Image templates|image templates]].
  
Line 15: Line 15:
 
</pre>
 
</pre>
  
[[Category:Image templates|{{PAGENAME}}]]</noinclude>
+
[[Category:Image templates]]</noinclude>

Revision as of 20:19, 14 July 2018

This is an image.
Sonic Retro emblem.svg
Ceci n'est pas un rétro.

This template is for anything that needs to be in a box styled as Sonic Retro itself is styled; it should be used instead of Box or a <div> tag unless necessary. It was originally created (and thus was named) for transclusion in image templates.

Usage

{{Imagetag
| image=
| text=
| imagewidth=
| imagelink=
}}