A site I am currently working on scores a little lower on Accessibility mainly because I have a lot of images that are sourced from a database. They are of course missing the Alt tags.
Is there a way to add dynamic alt tags?
A site I am currently working on scores a little lower on Accessibility mainly because I have a lot of images that are sourced from a database. They are of course missing the Alt tags.
Is there a way to add dynamic alt tags?
Bind them with App Connect syntax:
<img
dmx-bind:src="photo"
dmx-bind:alt="title"
>
Just to add to Ben's reply, you can make pretty much any attribute dynamic by adding the dmx-bind: prefix.
For example:
dmx-bind:alt="product.name"
dmx-bind:src="product.image"
dmx-bind:href="product.url"
dmx-bind:title="product.description"
dmx-bind:placeholder="formText.placeholder"
dmx-bind:disabled="!form1.valid"
So in general:
dmx-bind:attribute="your_dynamic_expression"