-
Notifications
You must be signed in to change notification settings - Fork 0
/
Picture.html
55 lines (50 loc) · 2.09 KB
/
Picture.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
<html
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:fc="http://typo3.org/ns/SMS/FluidComponents/ViewHelpers"
xmlns:ft="http://typo3.org/ns/Sitegeist/FluidTagbuilder/ViewHelpers"
data-namespace-typo3-fluid="true"
>
<fc:component>
<fc:param name="src" type="Sitegeist\MediaComponents\Domain\Model\ImageSource" />
<fc:param name="sources" type="Sitegeist\MediaComponents\Domain\Model\ImageSource[]" />
<fc:param name="alt" type="string" optional="1" />
<fc:param name="title" type="string" optional="1" />
<f:comment><!-- Scaling --></f:comment>
<fc:param name="height" type="integer" optional="1" />
<fc:param name="width" type="integer" optional="1" />
<fc:param name="maxDimensions" type="boolean" optional="1" />
<f:comment><!-- Delivery --></f:comment>
<fc:param name="lazyload" type="boolean" optional="1" />
<fc:param name="preload" type="boolean" optional="1" />
<fc:renderer>
<ft:picture :spaceless="1">
<f:for each="{sources}" as="source">
<fc:picture.source
src="{f:if(condition: source.originalImage, then: source, else: src)}"
format="{f:if(condition: source.format, then: source.format, else: src.format)}"
crop="{f:if(condition: source.crop, then: source.crop, else: src.crop)}"
srcset="{source.srcset}"
sizes="{source.sizes}"
media="{source.media}"
preload="{preload}"
/>
</f:for>
<fc:image
src="{src}"
height="{height}"
width="{width}"
crop="{src.crop}"
srcset="{src.srcset}"
maxDimensions="{maxDimensions}"
sizes="{src.sizes}"
format="{src.format}"
alt="{alt}"
title="{title}"
lazyload="{lazyload}"
preload="{preload}"
class="{class}"
/>
</ft:picture>
</fc:renderer>
</fc:component>
</html>