Template:Image: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
m
Text replacement - "<br>" to "<br/>"
mNo edit summary
m (Text replacement - "<br>" to "<br/>")
 
(14 intermediate revisions by one other user not shown)
Line 3: Line 3:
       {{#if:{{{scale|}}}
       {{#if:{{{scale|}}}
         |{{ImageSize|File:{{{file|}}}|{{{scale|}}}}}
         |{{ImageSize|File:{{{file|}}}|{{{scale|}}}}}
         |{{Percent|{{{file|}}}|{{{size|}}}}}
         |{{#if:{{{size|}}}|{{Percent|{{{file|}}}|{{{size|}}}}}}}
       }}
       }}
     }}<!--
     }}<!--
Line 13: Line 13:
     }}
     }}
   }}<!--
   }}<!--
-->{{#vardefine:image|[[File:{{{image|}}}|{{#var:imagesize}}|{{{title|{{{caption|}}}}}}|{{#var:link}}|alt={{{alt|File:{{{file|}}}}}}]]}}<!--
-->{{#vardefine:image|[[File:{{{file|}}}{{#if:{{#var:imagesize}}|{{!}}{{#var:imagesize}}}}|{{#var:link}}|alt={{{alt|File:{{{file|}}}}}}]]}}<!--
-->{{#switch:{{lc:{{{type|}}}}}
-->{{#switch:{{lc:{{{type|}}}}}
     |caption=<div class="thumb t{{#var:align}}"><!--
     |caption=<div class="thumb t{{#var:align}}"><!--
Line 20: Line 20:
     --></div></div></div>
     --></div></div></div>
     |thumb=<div class="thumb t{{#var:align}}"><!--
     |thumb=<div class="thumb t{{#var:align}}"><!--
     --><div class="thumbinner" style="width:{{#var:imagesize}};" title="{{{title|{{{caption|}}}}}}"> {{#var:image}}<!--
     --><div class="thumbinner" style="width:{{#var:imagesize}};" title="{{{title|{{{caption{{#var:link}}|}}}}}}"> {{#var:image}}<!--
     --><div class="thumbcaption"><!--
     --><div class="thumbcaption"><!--
     --><div class="magnify" style="margin-left:5px">[[File:Magnify-clip.png|link=File:{{{file}}}|Enlarge]]</div>{{{caption|}}}<!--
     --><div class="magnify" style="margin-left:5px">[[File:Magnify-clip.png|link=File:{{{file}}}|Enlarge]]</div>{{{caption|}}}<!--
     --></div></div></div>
     --></div></div></div>
     |normal|#default=<div title="{{{title|{{{caption|}}}}}}" align="{{#var:align}}" style="float:{{#var:align}}"> {{#var:image}}<!--
     |normal|#default=<div title="{{{title|{{{caption|{{#explode:{{#var:link}}|=|1}}}}}}}}" align="{{#var:align}}" style="float:{{#var:align}}">{{#var:image}}<!--
     --></div>
     --></div>
     }}
     }}
Line 41: Line 41:
==Usage==
==Usage==
To use this template, start with this code:
To use this template, start with this code:
<div style="float:right"><pre>
<div style="float:left; margin-right:20px"><pre>
{{Image
{{Image
|file        =  
|file        =  
Line 54: Line 54:
|link        =  
|link        =  
}}
}}
</pre></div>{{clear|left}}
</pre></div>


Here are descriptions of the parameters. Only the parameter "''image''" is actually required, the rest are optional.
Here are descriptions of the parameters. Only the parameter "''image''" is actually required, the rest are optional.
Line 60: Line 60:
{{parameter|type|The type of display for the image. Choices are ''normal'', ''thumb'', and ''caption''. ''Normal'' displays the image without any boxes or captions. ''Thumb'' displays the image in the traditional thumbnail box. ''Caption'' displays the image without any frame but with a boxed caption below it.|Optional|Defaults to ''normal'' if left blank}}
{{parameter|type|The type of display for the image. Choices are ''normal'', ''thumb'', and ''caption''. ''Normal'' displays the image without any boxes or captions. ''Thumb'' displays the image in the traditional thumbnail box. ''Caption'' displays the image without any frame but with a boxed caption below it.|Optional|Defaults to ''normal'' if left blank}}
{{parameter|size|The size of the image. Enter as a pixel number followed by a '''px''', or as a percentage number followed by a '''%'''. To specify height instead of width, enter the size as ''x##px''.|Optional}}
{{parameter|size|The size of the image. Enter as a pixel number followed by a '''px''', or as a percentage number followed by a '''%'''. To specify height instead of width, enter the size as ''x##px''.|Optional}}
{{parameter|scale|Use this if you instead wish to limit the overall size of the image to a certain pixel or percentage amount. Enter as a pixel number followed by a '''px''', or as a percentage number followed by a '''%'''. This will keep the image's dimensions within the specified amount.|optional}}  
{{parameter|scale|Use this if you instead wish to limit the overall size of the image to a certain pixel or percentage amount. Enter as a pixel number followed by a '''px''', or as a percentage number followed by a '''%'''. This will keep the image's dimensions within the specified amount. This is mostly for convenience, the same effect can be done in ''size'' through ''##x##px'', with the same number in both spots.|optional}}  
{{parameter|align|Set whether the image floats left or right.  Note that you can also use "position" as the name for this parameter.|Optional|Defaults to left if not defined.}}
{{parameter|align|Set whether the image floats left or right.  Note that you can also use "position" as the name for this parameter.|Optional|Defaults to left if not defined.}}
{{parameter|caption|Caption to display under the image. Only displays for the ''thumb'' and ''caption'' types.|Optional}}
{{parameter|caption|Caption to display under the image. Only displays for the ''thumb'' and ''caption'' types.|Optional}}
Line 67: Line 67:
{{parameter|alt|The text that is displayed when the image fails to load.|Optional|Defaults to the file name.}}
{{parameter|alt|The text that is displayed when the image fails to load.|Optional|Defaults to the file name.}}
{{parameter|link|The desired link. Can be internal or external. If you set this to "''none''", then the image will not create a link at all. Note: This only changes the image's link and it does not effect the enlarge link in image thumbnails. |Optional|Defaults to the image's page if left blank.}}
{{parameter|link|The desired link. Can be internal or external. If you set this to "''none''", then the image will not create a link at all. Note: This only changes the image's link and it does not effect the enlarge link in image thumbnails. |Optional|Defaults to the image's page if left blank.}}
 
==Examples==
<u><b>Basic</b></u>
<div style="float:left; margin-right:20px"><pre>
{{Image|file=Magic-Hammer.png}}
</pre></div>
{{clear}}
{{Image|file=Magic-Hammer.png}}
{{clear}}<br/>
<u><b>Thumbnail</b></u>
<div style="float:left; margin-right:20px"><pre>
{{Image|file=Magic-Hammer.png|type=thumb|caption=Magic Hammer from A Link to the Past.}}
</pre></div><br/>
{{Image|file=Magic-Hammer.png|type=thumb|caption=Magic Hammer from A Link to the Past.}}
{{clear}}<br/>
<u><b>Caption</b></u>
<div style="float:left; margin-right:20px"><pre>
{{Image|file=Magic-Hammer.png|type=caption|caption=Magic Hammer from A Link to the Past.}}
</pre></div><br/>
{{Image|file=Magic-Hammer.png|type=caption|caption=Magic Hammer from A Link to the Past.}}
{{clear}}


{{Cat|Formatting Templates}}
{{Cat|Formatting Templates}}
</noinclude>
</noinclude>

Navigation menu