[Prev: HTMLEXT] | [Resources][TOC] | [Next: ICONURLPREFIX]

# ICONS

- Syntax
- Description
- Default Setting
- Resource Variables
- Examples
- Version
- See Also

## Syntax

Envariable

  N/A

Element

  `<ICONS>
  ` icon-specification
  icon-specification
  ...
  `</ICONS>
  `

Command-line Option

  N/A

## Description

The ICONS resource is used to specify the icons that represent the different content-types of messages. This resource is used to define the possible expanded values of the `$ICON$` resource variable.

The ICON resource can only be defined via the resource file element. The format of each line in the `ICONS` element is as follows:

    content-type:url

The definition of each item is a follows:

content-type

  MIME content-type that an icon should be associated to. Examples: `text/plain`, `image/jpeg`. An icon can be associated to a base type by using a `*` as the sub-type. Examples: `text/*`, `image/*`. The default icon can be specified by using a content-type of `*/*`.

url

  The URL of the icon. Example: `http://host/icons/text.gif`, `/icons/image.gif`.

  The url can be prefixed with a width and height specification to provide rendering hints to browsers. The syntax for specify the width and height is as follows: `[WxH]`, where W is the width and H is the height. The following is an example URL setting with width and height specification: `[20x22]/icons/image.gif`.

  The width and height values map directly to the `WIDTH` and `HEIGHT` attributes of the HTML `IMG` element when `$ICON$` is used. Specifying the width and height decreases the rendering time of a page since browsers do not have to wait to fetch the image to determine how much area to provide for rendering.

In order to have icons appear in your pages, use the `$ICON$` resource variable. For example:

    <LiTemplate>
    $ICON$ <strong>$SUBJECT:40$</strong>
    <em>$FROMNAME$</em><br>
    </LiTemplate>

The `$ICON$` variable expands to the `IMG` HTML element with the appropriate URL in the `SRC` attribute to the icon. The `ALT` attribute of the `IMG` element contains the content-type of the message, surrounded by `[]`'s, for use with text based browsers. If the width and height values have been defined for the given URL as described earlier, they will map to the `WIDTH` and `HEIGHT` attributes.

The `$ICONURL$` resource variable may be used if you want redefine the format of the `IMG` element. For example:

    <LiTemplate>
    <img src="$ICONURL$" alt="*">
    <strong>$SUBJECT:40$</strong>
    <em>$FROMNAME$</em><br>
    </LiTemplate>

## Default Setting

Nil.

## Resource Variables

N/A

## Examples

The following example works well if using the Apache HTTP server and the default set of icons that are provided with it:

    <Icons>
    application/*;[20x22]/icons/generic.gif
    application/msword;[20x22]/icons/layout.gif
    application/postscript;[20x22]/icons/ps.gif
    application/rtf;[20x22]/icons/layout.gif
    application/x-csh;[20x22]/icons/script.gif
    application/x-dvi;[20x22]/icons/dvi.gif
    application/x-gtar;[20x22]/icons/tar.gif
    application/x-gzip;[20x22]/icons/compressed.gif
    application/x-ksh;[20x22]/icons/script.gif
    application/x-latex;[20x22]/icons/tex.gif
    application/octet-stream;[20x22]/icons/binary.gif
    application/x-patch;[20x22]/icons/patch.gif
    application/pdf;[20x22]/icons/pdf.gif
    application/x-script;[20x22]/icons/script.gif
    application/x-sh;[20x22]/icons/script.gif
    application/x-tar;[20x22]/icons/tar.gif
    application/x-tex;[20x22]/icons/tex.gif
    application/x-zip-compressed;[20x22]/icons/compressed.gif
    application/zip;[20x22]/icons/compressed.gif
    audio/*;[20x22]/icons/sound1.gif
    chemical/*;[20x22]/icons/sphere2.gif
    image/*;[20x22]/icons/image2.gif
    message/external-body;[20x22]/icons/link.gif
    multipart/*;[20x22]/icons/layout.gif
    text/*;[20x22]/icons/text.gif
    video/*;[20x22]/icons/movie.gif
    */*;[20x22]/icons/generic.gif
    </Icons>

## Version

1.0

## See Also

`$ICON$`, `$ICONURL$`, ICONURLPREFIX, LITEMPLATE, TLITXT, TSINGLETXT, TTOPBEGIN

The `m2h_external::filter` mime filter.

[Prev: HTMLEXT] | [Resources][TOC] | [Next: ICONURLPREFIX]