Skip to content

Render: image

Plugin ID: eca_render_image:image

Available since: 1.1.0

Build an image HTML element (not responsive).

Fields

URI — config key: uri

Either the relative path of the file or a full URL.
This field supports tokens.

Type: textfield · Required: yes · Default: empty string

Style name — config key: style_name

Optionally, specify the configuration ID of the image style to use.
This field supports tokens.

Type: textfield · Required: no · Default: empty string

Alt text — config key: alt

Specify the alternative text for text-based browsers.
This field supports tokens.

Type: textfield · Required: yes · Default: empty string

Title — config key: title

Optionally specify the value of the title attribute.
This field supports tokens.

Type: textfield · Required: no · Default: empty string

Width — config key: width

Optionally specify the value of the width attribute.
This field supports tokens.

Type: textfield · Required: no · Default: empty string

Height — config key: height

Optionally specify the value of the height attribute.
This field supports tokens.

Type: textfield · Required: no · Default: empty string

Machine name — config key: name

Optionally define a machine name of this render element. It will be made available under that name in the render array of the current event in scope. Nested elements can be set with using "][" brackets, for example details][title.
This field supports tokens.

Type: textfield · Required: no · Default: empty string

The machine name is a key in the render array of the event in scope. ECA's form events expose the form array itself as their render array, so under a Build form or Process form event this name is a form element key, and ][ nesting addresses nested form elements. See rendering HTMX elements into a form for what that makes possible.

Leaving the name empty is the usual choice for a standalone element. It is unsafe only together with the Build mode value Set and clear any previous value, which then replaces the whole render array instead of adding to it. See the note on the Build mode field.

Token name — config key: token_name

Optionally define a token name of this render element. It will be made available under that token name for later usage. Please provide the token name only, without brackets.

Type: textfield · Required: no · Default: empty string

Element weight — config key: weight

Optionally specify an element weight. The lower the weight, the element appears before other elements having a higher weight.
This field supports tokens.

Type: textfield · Required: no · Default: empty string

Build mode — config key: mode


When using the "Defined by token" option, make sure there is a token with this name: eca_render_image:image_mode

Type: select · Required: yes · Default: append

Allowed values: set:clear, set:clear:defined, merge, prepend, append, nothing, _eca_token

An empty machine name clears the whole render array

With this field set to Set and clear any previous value and no Machine name, the action adds nothing: it replaces the entire render array of the event in scope with the element it just built. Under a Build form event, whose render array is the form itself, that discards the whole form.

Use Set value when machine name is defined above whenever the name comes from a token that might resolve to nothing. That mode leaves the target untouched while the name is empty.