Template:Image: Difference between revisions

Template page
(Created page with "<templatestyles src="Image/styles.css"/><div class="t-image {{#ifeq:{{{padding|}}}|no||t-image-padding}}" {{#if:{{{width|}}}|style="max-width:{{{width}}}%"}}> [[File:{{{file|1AKC Samoyed Dog Show 2011.jpg}}}|{{{imagewidth|400}}}px|{{#ifeq:{{{border|}}}|yes|border{{!}}}}alt={{{caption|}}}|{{#if:{{{link|}}}|link={{{link|}}}}}]]{{#if: {{{caption|}}}| <p class="t-image-caption"> {{{caption}}} </p>}} </div><noinclude> This template is used to provide images with captions as a...")
 
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
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}}}%"}}>
<templatestyles src="Image/styles.css"/>
[[File:{{{file|1AKC Samoyed Dog Show 2011.jpg}}}|{{{imagewidth|400}}}px|{{#ifeq:{{{border|}}}|yes|border{{!}}}}alt={{{caption|}}}|{{#if:{{{link|}}}|link={{{link|}}}}}]]{{#if: {{{caption|}}}|
{{#ifeq: false | {{{round|}}} | | <templatestyles src="Image/rounded.css"/>}}
<div class="t-image {{#ifeq:{{{padding|}}}|no||t-image-padding}}" {{#if:{{{width|}}}|style="max-width:{{{width}}}%"}}>
[[{{#if: {{{noautofile|}}} ||File:}}{{{file|DefaultImage.webp}}}|{{{imagewidth|400}}}px|{{#ifeq:{{{border|}}}|yes|border{{!}}}}alt={{{caption|}}}|{{#if:{{{link|}}}|link={{{link|}}}}}]]{{#if: {{{caption|}}}|
<p class="t-image-caption">
<p class="t-image-caption">
{{{caption}}}
{{{caption}}}
Line 9: Line 11:
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]].
* '''<code>file=</code>''' Sets which file to use. Default value is [[:File:DefaultImage.webp|DefaultImage.webp]].
* '''<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.
* '''<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.
* <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%.  
* <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%.  
Line 15: Line 17:
* '''<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".
* '''<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".
* '''<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
* '''<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
* '''<code>round=</code>''' Set to "false" to disable corner rounding.
* '''<code>noautofile=</code>''' Set to anything to disable File: automatically being added to the start of the file name.
</noinclude>
</noinclude>

Latest revision as of 19:06, 3 May 2024

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 DefaultImage.webp.
  • 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= 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%.
  • 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
  • round= Set to "false" to disable corner rounding.
  • noautofile= Set to anything to disable File: automatically being added to the start of the file name.