Output an image for a link using UI thumbnails. mal2html.ui.links.img Parameters <code>$node</code>

A links element to link from.

<code>$thumbs</code>

A list of candidate uix:thumb elements.

<code>$role</code>

A link role, used to select the appropriate thumbnail.

<code>$width</code>

The width to fit thumbnails into.

<code>$height</code>

The height to fit thumbnails into.

This template selects the best-fit thumbnail from $thumbs, based on how well the aspect ratio and dimensions of each image matches the $width and $height parameters. It outputs an HTML img element for the best-fit thumbnail. It calls $mal2thml.ui.links.img.src to output the src attribute, and calls $mal2html.ui.links.img.attrs to output width and height attributes.

Before checking for a best-fit thumbnail on dimensions, this template first looks for uix:thumb elements with the type attribute set to "links". Within those, it looks for uix:thumb elements whose role attribute matches the $role parameter. This is similar to how link titles are selected.

If the $thumbs parameter is empty, this template attempts to use a default thumbnail provided by a uix:thumb child element of $node.

The $width and $height parameters can be computed automatically from the $node element.

Calls Parameters

Calls Templates