soo_image user guide Page 10 of 16


<txp:soo_image />

Display a single image.


None required (but see paragraph below). Unless otherwise stated, all attributes default to unset (“0” or empty).

Note that name will override id. If neither is declared, soo_image requires article or image context.

By default, the img tag produced by soo_image has height and width attributes set to the actual image dimensions, in pixels. You can change this in the plugin’s preferences so that these attributes are not added. In either case you can override the default setting by specifying height and/or width in soo_image:

You can also assign arbitrary CSS length values to either attribute. In this case, the value will be passed directly to the img tag. If you assign height such a value, but declare nothing for width, the img tag will have the specified height but will not have a width attribute (and vice versa); this preserves the correct aspect ratio.

Setting any of the link-related attributes (link, link_class, link_id, link_rel, link_to, or onclick) automatically enables both link and thumbnail.

Image selection attributes

Image tag attributes

Linked thumbnail attributes

Note: setting any of these automatically enables both link and thumbnail.

Example usage

Display the first image in the current image context

<txp:soo_image />

When used without name or id attributes, soo_image displays the first image in the current image context.

Linked thumbnail with onclick attribute

<txp:soo_image onclick="doSomething(this)" />

might produce

<a href="/images/28.jpg" onclick="return doSomething(this)" title="Sunrise">
<img alt="" src="/images/28t.jpg" title="Sunrise" /></a>

Using the link_to attribute

<txp:soo_image link_to="gallery/" />

might produce

<a href="gallery/?soo_img_jp=28" title="Sunrise">
<img alt="" src="/images/28t.jpg" title="Sunrise" /></a>

This page has an example of link_to in action.