Memory Alpha

Sidebar image/doc

36,850pages on
this wiki

Template page | < Template:Sidebar image

Revision as of 20:01, October 28, 2010 by Bp (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Usage Edit

This template is for use within the other sidebar templates. It is set to expand the image(s) to the proper size (a short list of variants exists, see below) and allows for the editing of one location to handle all sidebar images on the wiki at once.

This template makes use of the following parameters:

Image filenames, omitting the File: prefix. The first is mandatory in all cases. The second is optional - if used, it will lead to both images being displayed side by side.
Descriptions for both images. While strictly optional, it is considered good style to always add a short text for any image used. This text will be considered the "alternative" to the image - it will be displayed if the image can't be shown. This alternative should actually describe the image in detail, as it is also used by people with visual impairment. This text will not be displayed as a subtitle to the image. If such is considered necessary in a specific sidebar, it should be added via that sidebar template.
Titles of both images. These will be shown as "mouseover" tooltips.
This needs to be used only when trying to display two images, and determines the width of the left image. It can be used to tune the relative heights of the two images. It is an optional parameter, defaulting to half of the allowed width.
Currently, this parameter has only one allowed value, "halfwidth". If used, it will lead to the single image being displayed smaller.

Examples Edit

Example sidebar
The planet Earth as seen from space, with the North American continent visible through the clouds
Q as God
Federation logo

The example sidebar to the right shows resulting formatting of the image(s), if this template is called with appropriate parameters from within a standard sidebar.

Standard: one image Edit

This is the easiest case, using variables img1 and, optionally, alt1 and cap1 to display a single image using the full width available in a standard sidebar:

{{sidebar image
 |img1 = Earth.jpg
 |alt1 = The planet Earth as seen from space,
         with the North American continent
         visible through the clouds
 |cap1 = Earth

For ease of use, parameter names can be dropped in this case, leading to the simple form of:

{{sidebar image|FILENAME|CAPTION}}

Special case 1: two images side by side Edit

If two smaller images need to be displayed, the following syntax can be used:

{{sidebar image
 |img1 = Q as God.jpg
 |alt1 =
 |cap1 = Q as God
 |img2 = Trelane.jpg
 |alt2 =
 |cap2 = Trelane
 |size = 137

In this case, named parameters need to be used for both image filenames (img1/img2). Captions (cap1/cap2) are optional. Additionally, the width (in px) of the left image can be determined by the parameter size. The width of the right image will then be automatically adjusted by the template.

Special case 2: one image, half width Edit

If a single image needs to be displayed in a smaller size, the following syntax can be used:

{{sidebar image
 |img1   = United_Federation_of_Planets_logo.svg
 |alt1   =
 |cap1   = Federation logo
 |format = halfwidth

This special case is activated by using the format parameter with the value "halfwidth". As above, named parameters (img1/cap1) need to be used for the image and its caption text.

Around Wikia's network

Random Wiki