Skip to content

Instantly share code, notes, and snippets.

@aertmann
Last active August 17, 2016 08:34
Show Gist options
  • Save aertmann/3f8874aead5aa2257f9f to your computer and use it in GitHub Desktop.
Save aertmann/3f8874aead5aa2257f9f to your computer and use it in GitHub Desktop.
Image partial for responsive images in Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
{namespace media=TYPO3\Media\ViewHelpers}
<media:image
additionalAttributes="{srcset: '{media:uri.image(image: image, maximumWidth: 400)} 2x,
{media:uri.image(image: image, maximumWidth: 200)} 1x'}"
asset="{image}"
alt="{alternativeText}"
title="{title}"
maximumWidth="200" />
<img srcset="/_Resources/Persistent/50c6488589075ac9438ae888305d005532702d10/picture.jpg 2x,
/_Resources/Persistent/7f9a8873fd4095f814ffaffbb17f49343be9b29d/picture.jpg 1x"
width="200"
height="150"
src="/_Resources/Persistent/7f9a8873fd4095f814ffaffbb17f49343be9b29d/picture.jpg">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment