Asset.image ViewHelper <vite:asset.image> 

The <vite:asset.image> ViewHelper allows to customize the preloading of images referenced by the entry point of the <vite:asset> ViewHelper, for example images used in CSS files. It can only be used as a direct child element of <vite:asset>.

By default, no images are preloaded, as images referenced in CSS files are rarely critical for the initial rendering of the page.

See <vite:asset> for more examples.

Example: Preload SVG images 

<vite:asset entry="EXT:sitepackage/Resources/Private/JavaScript/Main.entry.js">
    <vite:asset.image preload="{true}" formats="svg" />
</vite:asset>
Copied!

Arguments

The following arguments are available for the asset.image ViewHelper:

formats

formats
Type
string
Default
''
Comma-separated list of file extensions that should be preloaded. If empty, all images are preloaded.

preload

preload
Type
bool
Default
false
Set to "true" if referenced images should be preloaded.