1

I know this essentially does the trick, however I was hoping I could apply a custom transform to all image assets if one hasn't been defined by the user.

The problem I have is trying to convey the importance of defining image transforms to my "less-than-savvi" clients.

So, as a fallback I'd like to know if I can query any images and apply an image transform. I feel like this might be a step in the right direction, but not sure what to do next:

{{ include(template_from_string(entry.body)|raw) }}

Cheers.

1 Answer 1

3

I wrote a plugin called Retcon which is able to apply bulk image transforms to images in HTML/Redactor content:

{{ entry.body|retconTransform({ width : 1024 }) }}
{{ entry.body|retconTransform(myAwesomeTransform) }}

There's currently no way to tell Retcon to only transform images that hasn't already been transformed, though – so this might not be exactly what you're looking for.

1
  • Very nice, thanks Mats. Apologies for the late reply too! Commented Jul 24, 2016 at 23:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.