Template:Image: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<templatestyles src="Image/styles.css"/><div class="t-image {{#ifeq:{{{padding|}}}|no||t-image-padding}}" {{#if:{{{width|}}}|style="max-width:{{{width}}}%"}}>
<div class="banner-image {{#ifeq: {{{align|}}}|left| banner-image-left|}}{{#ifeq: {{{align|}}}|none| banner-image-none|}}{{#ifeq: {{{align|}}}|center| banner-image-center|}}" style="max-width:{{{width|400px}}};{{#ifeq: {{{padding|}}}|no|| padding-left:1.5em;}}">
[[File:{{{file|MattP(1).png}}}|{{{imagewidth|400}}}px|{{#ifeq:{{{border|}}}|yes|border{{!}}}}alt={{{caption|}}}|{{#if:{{{link|}}}|link={{{link|}}}}}]]{{#if: {{{caption|}}}|
[[File:{{{file|MattP(1).png}}}|{{{width|400px}}}|{{#ifeq:{{{border|}}}|yes|border{{!}}}}alt={{{caption|}}}|{{#if:{{{link|}}}|link={{{link|}}}}}]]{{#if: {{{caption|}}}|
<p class="t-image-caption">
<p style="font-size: 90%;">
{{{caption}}}
{{{caption}}}
</p>}}
</p>}}
</div><noinclude>
</div><noinclude>
{{documentation|content=
<div style="clear:both;">
{{Uses TemplateStyles|Template:Image/styles.css}}
----
'''Template documentation'''
 
This template is used to provide images with captions as an alternative to the ugly image captions that come with MediaWiki.
This template is used to provide images with captions as an alternative to the ugly image captions that come with MediaWiki.


Syntax:
Syntax:


* '''<code>file=</code>''' Sets which file to use. Default value is [[commons:File:1AKC Samoyed Dog Show 2011.jpg|1AKC Samoyed Dog Show 2011.jpg]].
* '''<tt>file=</tt>''' Sets which file to use. Default value is [[commons:File:1AKC Samoyed Dog Show 2011.jpg|1AKC Samoyed Dog Show 2011.jpg]].
* '''<code>width=</code>''' 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.
* <s>'''<code>percentage=</code>'''</s> '''Never used''' 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%.
* '''<code>caption=</code>''' Places a caption beneath the image, and also serves as the alt text. Optional.
* '''<tt>align=</tt>''' Sets alignment of image and caption block. Options are right, left, center, and none. Default is right.
* '''<code>padding=</code>''' 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>caption=</tt>''' Places a caption beneath the image, and also serves as the alt text. Optional.
* '''<code> link=</code>''' Allows the image to link to a different page. Default is to link to the image description page. Set <code>link=</code> to nothing and the image will not be clickable
* '''<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></noinclude>
</noinclude>

Revision as of 15:13, 19 February 2024


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 1AKC Samoyed Dog Show 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