Reputation: 3488
I override cropVariants for Image Manipulation like this:
But how can I render the FIRST image depending on specific cropVariant in fluid? Let say for 'mobile' for @media (max-width: 575px){} ...?
Debug in the template shows for the first 'Create new relation' media file (jpg image) the following for crop:
<f:debug>{data}</f:debug>
array(85 items)
...
media => array(1 item)
0 => TYPO3\CMS\Core\Resource\FileReferenceprototypeobject
propertiesOfFileReference => protectedarray(35 items)
...
crop => '{"desktop":{"cropArea":{"x":0.011,"y":0,"width":0.924,"height":0.99047619047
619},"selectedRatio":"NaN","focusArea":null},"mobile":{"cropArea":{"x":0.094,"y":1.917337540
94e-15,"width":0.786,"height":0.99809523809524},"selectedRatio":"3:2","focus
Area":null}}' (392 chars)
...
Upvotes: 1
Views: 760
Reputation: 213
<f:image
src="{image.0.uid}"
treatIdAsReference="1"
width="1140"
height="375"
cropVariant="desktop"
/>
Upvotes: 1