linkImage(embeddedId, [width], [height], [mode]) Last updated: 30. May 2026

Creates a link to an image within a document. Only works from site display templates for documents.

See also: linkFile Image scaling Path traversal

Parameters

Name Type Description
embeddedId string

ID of the embedded image resource you want to generate a reference to.

width (optional) number

Target width for scaling (behaviour varies, see specified mode)

height (optional) number

Target height for scaling (behaviour varies, see specified mode)

mode (optional) number

See list and description of modes:
Image scaling

Returns

A working link to the specified image and scaling.

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
When using src attributes:
<img src="#docly.linkImage(Image1, 160, 120, 1)#" alt="Image" />

When using style background image or other plugins:
<div style="background-image:url('~#docly.linkImage(Image1, 160, 120, 1)#')"></div>

Plugin example:
<div data-plugin-image="~#docly.linkImage(Image1, 160, 120, 1)#"></div>

Output

The #JS code above produces the output shown below:
No demo available.