Asset.image ViewHelper <vite:asset.image>
The <vite: ViewHelper allows to customize the preloading of
images referenced by the entry point of the <vite: ViewHelper, for
example images used in CSS files. It can only be used as a direct child
element of <vite:.
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
-
- Type
- string
- Default
- ''
Comma-separated list of file extensions that should be preloaded. If empty, all images are preloaded.
preload
-
- Type
- bool
- Default
- false
Set to "true" if referenced images should be preloaded.