addedValueMacros.scaledPictureRef
Syntax
{addedValueMacros.scaledPictureRef(shortcutName, widthWanted="", heightWanted="", explanation=nil, hspace="", align="", usemap="", ismap=false, border=0, glossref="", vspace="", lowsrc="", rollsrc="", name="", id="", style="", class="", title="", onload="", onabort="", onerror="", onmouseOver="", onmouseOut="", onClick="", suffix = "", whatTarget="")}
- shortcutname - the shortcut name of a picture to be displayed.
- widthWanted (optional)- if supplied, maximum width the scaled picture should be
- heightWanted (optional) - if supplied, maximum height the scaled picture should be
- suffix (optional) - if supplied, a string that appears after the picture
- whatTarget (optional) - if supplied, and a value for glossRef is applied also, addsa target to the a tag that enclose the img tag.
Examples
| {addedValueMacros.scaledPictureRef("pic_Variable Applies To", 120, 120)} |
 |
| {picturelink(addedValueMacros.scaledPictureRef("pic_Variable Applies To", 120, 120, border:1), "pic_Variable Applies To")} |
 |
Semantics
This is a souped up version of Manila's
pictureRef Macro. There a 4 distinct categories of changes between this macro and the Manila original.
- the parameter list has been extended to include every legal attribute of the img tag (most accessibility tags)
- Proportional Scaling. widthwanted and heighWanted are used to compute 2 scaling factors, one for height and one for width. The smaller is chosen and the picture is scaled using that number in both axes. In other words, the picture is adjusted to fit in the specified box, but it is not distorted.
- event handlers that apply if a link is made from the picture using the glossRef parameter. (onMouseOver, onMouseOut, onClick)
- a suffix string has been added
Many pictures in this website are rendered using this macro. One particularly useful trick is to use a scaled down verison of an image as a link to the full sized image. This is done with Manila's
pictureLink Macro or the manilaFixer plugin
pictureLink Macro which adds a target attribute to the link. The second example illustrates this technique.