Difference between revisions of "Template:Image"

From Wikimedia District of Columbia
Jump to navigation Jump to search
(align style)
(Update alignment markup)
 
(35 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="banner-image" style="width:{{{percentage|50%}}}; max-width:{{{width|350px}}}; float:{{{align|right}}}; align:{{{align|right}}}; padding-left:1.5em;">
+
<div class="banner-image {{#switch:{{{align|}}}|left=banner-image-left|none=banner-image-none|right|#default=banner-image-right}}" style="max-width:{{{width|400px}}};{{#ifeq: {{{padding|}}}|no|| padding-left:1.5em;}}">
[[File:{{{file|Example title.svg}}}|{{{width|350px}}}|{{{align|right}}}|alt={{{caption|}}}]]{{#if: {{{caption|}}}|
+
[[File:{{{file|AKC Great Falls June 2011.jpg}}}|{{{width|400px}}}|{{#ifeq:{{{border|}}}|yes|border{{!}}}}alt={{{caption|}}}|{{#if:{{{link|}}}|link={{{link|}}}}}]]{{#if: {{{caption|}}}|
<div style="font-size: 90%;">
+
<p style="font-size: 90%;">
 
{{{caption}}}
 
{{{caption}}}
</div>}}
+
</p>}}
 
</div><noinclude>
 
</div><noinclude>
 
<div style="clear:both;">
 
<div style="clear:both;">
Line 13: Line 13:
 
Syntax:
 
Syntax:
   
* '''<tt>file=</tt>''' Sets which file to use. Default value is Example title.svg.
+
* '''<tt>file=</tt>''' Sets which file to use. Default value is [[commons:File:AKC Great Falls June 2011.jpg|AKC Great Falls June 2011.jpg]].
 
* '''<tt>width=</tt>''' The maximum width of the image. Note that the image gets smaller so that it is never more than a certain percentage of the browser window. Defaults to 400px.
 
* '''<tt>width=</tt>''' The maximum width of the image. Note that the image gets smaller so that it is never more than a certain percentage of the browser window. Defaults to 400px.
 
* '''<tt>percentage=</tt>''' The percent width of the browser window the image takes up. The width proportionality is maintained until the image is at the maximum size; it does not get better. Defaults to 50%.
 
* '''<tt>percentage=</tt>''' The percent width of the browser window the image takes up. The width proportionality is maintained until the image is at the maximum size; it does not get better. Defaults to 50%.
* '''<tt>align=</tt>''' Sets alignment of image and caption block. Default value is right.
+
* '''<tt>align=</tt>''' Sets alignment of image and caption block. Options are right, left, center, and none. Default is right.
 
* '''<tt>caption=</tt>''' Places a caption beneath the image, and also serves as the alt text. Optional.
 
* '''<tt>caption=</tt>''' Places a caption beneath the image, and also serves as the alt text. Optional.
  +
* '''<tt>padding=</tt>''' Gives the option to turn off padding, in case the image is part of a floating div already. Default is to include padding; turn off by setting parameter to "no".
  +
* '''<tt> link=</tt>''' Allows the image to link to a different page. Default is to link to the image description page. Set <tt>link=</tt> to nothing and the image will not be clickable
   
 
</div>
 
</div>

Latest revision as of 16:26, 15 July 2017


Template documentation

This template is used to provide images with captions as an alternative to the ugly image captions that come with MediaWiki.

Syntax:

  • file= Sets which file to use. Default value is AKC Great Falls June 2011.jpg.
  • width= The maximum width of the image. Note that the image gets smaller so that it is never more than a certain percentage of the browser window. Defaults to 400px.
  • percentage= The percent width of the browser window the image takes up. The width proportionality is maintained until the image is at the maximum size; it does not get better. Defaults to 50%.
  • align= Sets alignment of image and caption block. Options are right, left, center, and none. Default is right.
  • caption= Places a caption beneath the image, and also serves as the alt text. Optional.
  • padding= Gives the option to turn off padding, in case the image is part of a floating div already. Default is to include padding; turn off by setting parameter to "no".
  • link= Allows the image to link to a different page. Default is to link to the image description page. Set link= to nothing and the image will not be clickable