Template:FreedImg/doc

From testwiki
Jump to navigation Jump to search

Template:Documentation subpage Template:Uses TemplateStyles Template:Lua

  • Use this image container template to display CENTERED images.
  • Resizes the container dynamically and provides additional image related features.
  • When used to display an offset image, the surrounding text is broken into a new paragraph.

Usage

  • Always please use the shortcut to FreedImg, Template:Tl, rather than the long template name.
{{FI
 | type         =
 | file         =
 | width        =
 | imgwidth     =
 | cclass       =
 | cstyle       =
 | float        =
 | margin-left  =
 | margin-right =
 | clear        =
 | caption      =
 | tmleft       =
 | indent       =
 | tstyle       =
 | talign       =
 | alt          =
 | link         =
 | page         =
}}

For true inline usage, please see FreedImg/span, Template:Tl, instead.

Parameters

For the Image itself
  • mandatory Template:Parameter: File name (without the "File:" prefix).
    • optional Template:Parameter: Image alt-text, ie. for mouse-over text box or for use with a screenreader for the visually impaired.
    • optional Template:Parameter: Override the default image link with an internal/external URL of your choosing (optional)
    • optional Template:Parameter: Select individual image page within a multi-page file (PDF/DJVU etc.; optional)
when the (Template:Parameter=user ) is present & set
  • Images generated by certain wikicode extensions (e.g. the default <math> User preference, <score>, etc.) may be entered in the named Template:Parameter parameter instead.
Primary DIV container
  • Template:Parameter: The width of the primary container, by percentage (present, variable, default 100%)
  • Template:Parameter: The class for the primary container, (present, variable, default floatnone [a null undefined classname just for placeholder purposes])
  • Template:Parameter: Any special overall styles to apply to primary container (default: no extra CSS).
  • Template:Parameter: The alignment of the primary container (not present; must be added, options are "left" or "right"; otherwise remains centered).
  • Template:Parameter: The margin(s) of the primary container to be cleared (not present; must be added, options are "left", "right" or "both").
  • Template:Parameter,Template:Parameter : Any special margins to be applied to the primary container (defaults appropriate for centered result).
Image element
  • Template:Parameter: extra CSS classes to add (often rotations)
  • Template:Parameter: extra CSS styling to add to the image (e.g. borders)
  • Template:Parameter: request this size of image from the server, rather than computing a guess. This can help to reduce file size, for example, when you know the image will be used in a narrow container.
Image Caption

Examples

Basic example: centred image

{{FI
 | file     = Iceberg.jpg
 | width    = 20%
 | link     = w:Iceberg{{!}}Iceberg article at Wikipedia
 | alt      = WS Iceberg
}}

Template:FI

Musical score

{{FI
 | type  = score
 | width = 50%
 | file  = <score>{ \clef bass \time 3/4 g,4 (b,4 [d4 f4 a4]) r4 \bar "|." }</score>
}}

Template:FI

Mathematical Equation

Template:Smaller

{{FI
 | type  = math
 | width = 25%
 | file  = <math>sin x = {e^{ix} - e^{-ix} \over 2i} </math>
}}

Template:FI

Page of a multipage document

{{FI
 | file     = Character of Renaissance Architecture.djvu
 | width    = 20%
 | link     = Character of Renaissance Architecture
 | alt      = Plate III: Cvpola Di S Pietro
 | page     = 91
}}

Template:FI

Adding classes to the image (e.g. rotation)

{{FI
 | file     = Iceberg.jpg
 | width    = 20%
 | link     = w:Iceberg{{!}}Iceberg article at Wikipedia
 | alt      = WS Iceberg
 | imgclass = rot270
 | caption  = Gravity right
}}
{{FI
 | file     = Iceberg.jpg
 | width    = 40%
 | link     = w:Iceberg{{!}}Iceberg article at Wikipedia
 | alt      = WS Iceberg
 | imgclass = rot90
 | caption  = Gravity left
}}
Template:FI Template:FI
rowsapn=2 Template:Ts| Template:FI rowsapn=2 Template:Ts|
colspan=3 Template:Ts|
{{FI
 | file     = Iceberg.jpg
 | width    = 40%
 | link     = w:Iceberg{{!}}Iceberg article at Wikipedia
 | alt      = WS Iceberg
 | imgclass = rot180
 | caption  = Gravity up
}}

Extra CSS styles

{{FI
 | file     = Iceberg.jpg
 | width    = 10%
 | imgstyle = outline: solid 3px blue;
 | caption  = An iceberg
 | tstyle   = background-color: yellow; font-family:serif;
 | cstyle   = border: dashed 1px red; padding: 10px;
}}

Template:FI


Missing images

If an image doesn't exist yet, you can use missing in the Template:Parameter parameter:

Template:Doc example


See also