Pāriet uz saturu

Veidne:Annotated image

Vikipēdijas lapa
Dokumentācijas ikona Veidnes dokumentācija[skatīt] [labot] [hronoloģija] [pārlādēt]

This template allows the addition of explanatory notes to images in the form of actual text (which can also contain links), which is usually more legible than text built into the image – especially if the image is reduced to thumbnail size.

Other uses include cropping an image to exclude unimportant parts and perhaps enlarge important parts, and internationalisation, as the annotations can be changed without changing the image.

For examples see Template:Annotated image/doc/Samples.

All parameters have names – there are no nameless "numbered" parameters.

Two of the parameters, image and imagemap, are mutually exclusive – use one of them but not both.

In most cases you will need only the required parameters – the rest are there in case you want additional formatting options.

NameAllowed valuesDefault valueFunction & notes
captionwikitext(required)Caption of the image, goes in the usual place for image captions.
alttextemptyAlt text of image, for readers who cannot see it; see WP:ALT.
imagevalid image file name; SVG images are allowed(see note)You must specify image or imagemap but not both.
imagemapvalid (X)HTML imagemap(see note)You must specify image or imagemap but not both.
widthpositive integer(optional)Total width (in pixels) of the box containing the image and annotations. Must be at least as large as the image's displayed width (which you can set by using image-width).
heightpositive integer(optional)Total height (in pixels) of the box containing the image and annotations. Must be at least as large as the image's displayed height. If you change the displayed width of the image by specifying image-width, you will have to work out the image's displayed height and then add any "margins" you need for annotations.
image-leftpositive integer(optional; defaults to 0)X-coordinate of the image's top left corner (in pixels), relative to the top left corner of the box containing the image and annotations.
image-toppositive integer(optional; defaults to 0)Y-coordinate of the image's top left corner (in pixels), relative to the top left corner of the box containing the image and annotations.
image-widthpositive integer(required)Width of the image (in pixels).
annotationsrequiredmay be left empty (annotations=) if you simply want to crop an imageAnnotations for the image.
floatright
left
none
rightMakes the template's output float to the right or left of the text..
outer-cssany valid CSS(optional, no default value)Additional CSS for the outermost box. Cannot over-ride any other parameters that you specify for the outer box. It is best to use this only as a last resort.
image-bg-colorany valid CSS colorwhiteBackground of the box in whichi the image is displayed. You might want to set a dark background if the image is dark and you want to use a light color for the annotations.
image-cssany valid CSS(optional, no default value)Additional CSS for the image (or rather, the invisible box that contains it). Cannot over-ride any other parameters that you specify for the image's box. It is best to use this only as a last resort.
annot-text-alignleft
right
center
leftSets a default text-alignment for all the contained annotations. You can over-ride this for individual annotations if you wish.
annot-background-colorany valid CSS colortransparentSets a default background-color for all the contained annotations. You can over-ride this for individual annotations if you wish.
annot-font-familyany valid CSS font-family(optional, no default value)Sets a default font-family for all the contained annotations. You can over-ride this for individual annotations if you wish.
annot-font-sizepositive integer(optional, no default value)Sets a default font-size (in pixels) for all the contained annotations. You can over-ride this for individual annotations if you wish.
annot-font-weightany valid CSS font-weight(optional, no default value)Sets a default font-weight for all the contained annotations. You can over-ride this for individual annotations if you wish.
annot-font-styleany valid CSS font-style (e.g. italic)(optional, no default value)Sets a default font-style for all the contained annotations. You can over-ride this for individual annotations if you wish.
annot-line-heightany valid CSS line-height(optional, no default value)Sets a default line-height (line spacing) for all the contained annotations. You can over-ride this for individual annotations if you wish. Only useful for multi-line annotations.
annot-font-familyany valid CSS font-family(optional, no default value)Sets a default font-family for all the contained annotations. You can over-ride this for individual annotations if you wish.
annot-colorany valid CSS color(optional, no default value)Sets a default color for all the contained annotations. You can over-ride this for individual annotations if you wish.

Template:Annotated image/Extinction

Internationalisation

[labot pirmkodu]

This template makes internationalisation easy – the text is already separate from the image, so it is easy to translate the text and, if necessary, move pieces of text, as the lengths of the same text in different languages can vary a lot. For example nl:Sjabloon:Zijbalk mariene extincties, the Dutch version of Template:Annotated image/Extinction, is widely used..

There is one pitfall, although it is mainly about using one browser in the correct way (Microsoft Internet Explorer, of course). Internet Explorer has two ways of scaling-up text to ease readability:

  • Text resizing, which appears in Internet Explorer's View menu, affects text but not images. This method can disrupt annotated images, as the text is scaled up but the image content and frame are not. Firefox and Opera do not use this mechanism.
  • Zoom also scales the image as well as text annotations, and thus does not disrupt the relative sizes and locations of annotations in annotated images. Netscape and its Mozilla derivatives, Firefox and Opera have had zoom for years, and it is more useful, as it also scales text implemented as part of an image, e.g., as in the Wikipedia logo. The zoom control sequences (CTRL + to increase, CTRL - to decrease) are the same in Firefox, Opera and Internet Explorer. In Firefox and Opera, there also menu items for zoom, which show the control sequences. In Internet Explorer 7 only text resizing appears in the menu; in order to learn zoom, users must look up some external source.

Subpages: templates based on this one

[labot pirmkodu]

This list is automatically generated and updated. Redirects are shown in italics.

See also

[labot pirmkodu]