1

If you insert an image in a Rich Text field you get an option to apply a transform, but that is not true when using an Asset field to choose an image, which seems strange. Is there any way to accomplish that?

1

Asset fields require a transform to be set manually in the template or can be Created in the dashboard and the transform name used in the template.

{% set thumb = {
    mode: 'crop',
    width: 100,
    height: 100,
    quality: 75,
    position: 'top-center'
} %}

<img src="{{ asset.getUrl(thumb) }}">
  • Agreed. Where you decide to set the transform, either in the template or in the CP depends on whether you want to store more information in the DB or let the template do the work. I've been putting transforms in templates because it allows me to use the same transform name (eg. myHeaderTransform), but apply different settings in each template. – Vaughn D. Taylor Dec 22 '18 at 14:32
  • Yes, I understand how to call a transform in a template, but that does not support having the content person apply a transform, without me adding another control field in the CP. In any case, the real issue here is that there is inconsistent user experience between inserting an image using Redactor versus an Asset field. – Roi Agneta Dec 22 '18 at 16:24
  • Then you can add a field or a few to the asset field layout and the user can set them when adding an asset. Or make it a separate field alongside the assets. I’ll update my answer shortly – Indigo Viking Dec 22 '18 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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