/
image.html
55 lines (55 loc) · 3.18 KB
/
image.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2016 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<div data-sly-use.image="com.adobe.cq.wcm.core.components.models.Image"
data-sly-use.component="com.adobe.cq.wcm.core.components.models.Component"
data-sly-use.templates="core/wcm/components/commons/v1/templates.html"
data-sly-test="${image.src}"
data-cmp-is="image"
data-cmp-lazy="${image.lazyEnabled}"
data-cmp-lazythreshold="${image.lazyThreshold}"
data-cmp-src="${image.srcUriTemplate ? image.srcUriTemplate : image.src}"
data-cmp-widths="${image.widths}"
data-cmp-dmimage="${image.dmImage}"
data-cmp-smartcroprendition="${image.smartCropRendition}"
data-asset="${image.fileReference}"
data-asset-id="${image.uuid}"
data-title="${image.title || image.alt}"
id="${component.id}"
data-cmp-data-layer="${image.data.json}"
class="cmp-image${!wcmmode.disabled ? ' cq-dd-image' : ''}"
itemscope itemtype="http://schema.org/ImageObject">
<a data-sly-unwrap="${!image.link}"
class="cmp-image__link" href="${image.link}"
data-cmp-clickable="${image.data ? true : false}"
data-cmp-hook-image="link">
<noscript data-sly-unwrap="${image.smartCropRendition != 'SmartCrop:Auto' && (!image.lazyEnabled && image.widths.length <= 1 && !image.areas)}" data-cmp-hook-image="noscript">
<sly data-sly-test.usemap="${'{0}{1}' @ format=['#', resource.path]}"></sly>
<img src="${image.src}" class="cmp-image__image" itemprop="contentUrl" data-cmp-hook-image="image"
data-sly-attribute.usemap="${image.areas ? usemap : ''}"
alt="${image.alt || true}" title="${image.displayPopupTitle && image.title}"/>
<map data-sly-test="${image.areas}"
data-sly-list.area="${image.areas}"
name="${resource.path}"
data-cmp-hook-image="map">
<area shape="${area.shape}" coords="${area.coordinates}" href="${area.href}" target="${area.target}" alt="${area.alt}"
data-cmp-hook-image="area" data-cmp-relcoords="${area.relativeCoordinates}">
</map>
</noscript>
</a>
<span class="cmp-image__title" itemprop="caption" data-sly-test="${!image.displayPopupTitle && image.title}">${image.title}</span>
<meta itemprop="caption" content="${image.title}" data-sly-test="${image.displayPopupTitle && image.title}">
</div>
<sly data-sly-call="${templates.placeholder @ isEmpty = !image.src, classAppend = 'cmp-image cq-dd-image'}"></sly>