4W WebMerge Tag Reference

WM-ImagePath

Syntax
[WM-ImagePath: fieldName]
[WM-ImagePath: fieldName nolink]

Examples
[WM-ImagePath: ImageFile]

[WM-ImagePath: ImageFile  width="100" height="100]

Description

The [WM-ImagePath] tag is replaced by an <img> tag in the generated page, using the file path in the data of the field specified in fieldName as the src attribute.

In the example shown above, if your database includes a field named "ImageFile", you can include the path to an image file in that field. Using this tag, WebMerge will build an <img> tag, using the data in the database field as its source, like this:

<img src="images/mypicture.jpg">

When used in an index template, by default WebMerge generates all tags as links to the corresponding detail page. The optional nolink attribute is used in index pages to tell WebMerge to write the <img> tag without linking it to that detail page. If used in an detail page template, the nolink attribute is ignored.

Adding Image Attributes
HTML supports a variety of attributes for images, such as specifying the width or height of an image, its border size, and more. You can include these in your WM-ImagePath tag. Anything between the end of the specified file and the closing bracket ("]") is assumed to be your own HTML attributes, and are copied into the generated IMG tag for you.

For instance, the HTML WebMerge would generate from the last example above would look like:

<img src="image/mypicture.jpg" width="100" height="100">

Introduced in version 1.8.
Verison 2.4 introduced support for additional image attributes to be included with the generated HTML.