[IMP] web: add support for itemprop on img
Take the following QWeb snippet:
```
<div t-field="product.image" itemprop="image" t-options="{'widget': 'image'}"/>
```
When the image is rendered, the `itemprop="image"` remains on the
`<div>` tag, it is not set on the `<img>` tag.
We add the support of the `itemprop` option, so it can be added to the
`<img>` tag:
```
<div t-field="product.image" t-options="{'widget': 'image', 'itemprop': 'image'}"/>
```
opw-2076934
This commit is contained in:
@@ -69,8 +69,13 @@ class Image(models.AbstractModel):
|
||||
elif options.get('zoom'):
|
||||
src_zoom = options['zoom']
|
||||
|
||||
itemprop = None
|
||||
if options.get('itemprop'):
|
||||
itemprop = options['itemprop']
|
||||
|
||||
atts = OrderedDict()
|
||||
atts["src"] = src
|
||||
atts["itemprop"] = itemprop
|
||||
atts["class"] = classes
|
||||
atts["style"] = options.get('style')
|
||||
atts["alt"] = alt
|
||||
|
||||
Reference in New Issue
Block a user