For the complete documentation index, see llms.txt. This page is also available as Markdown.

Image Binding

Image binding safely assigns image URLs after component data is available. Use `data-image` to prevent premature requests from unresolved template bindings.

Documentation

Which components support image binding?

The following components support image binding:

  • ff-record

  • ff-suggest-item

  • ff-asn-group-element

Understanding image binding

By default, src="{{image}}" will be added to all children of an image binding element that have a data-image attribute.

The src attribute will only be added once data binding is available.

Using src="{{image}}" directly in the template could lead to invalid requests.

For example, this ff-suggest would show the suggested product's image:

<ff-suggest>
    <section class="productsContainer">
        <ff-suggest-item type="productName">
            <img width="100" height="100" data-image />
        </ff-suggest-item>
    </section>
</ff-suggest>

You can overwrite the default binding by providing a value for the data-image attribute.

See the API tab for further supported attributes on image binding elements.

API

Elements with Image binding

Properties

Name
Description

product-image-identifier (String) (default: "[data-image]")

CSS selector that determines targeted children for data binding.

product-image-error-identifier (String) (default: "data-image-onerror")

If this names an attribute on a targeted image and no onerror callback exists, its value becomes the src value on onerror.

Last updated

Was this helpful?