Last active
March 10, 2020 14:11
-
-
Save gjhead/e5b03ab902bec22efb6c728de0de3428 to your computer and use it in GitHub Desktop.
craft cms - can't do max-width for transforms so you need to check it before the transform.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if asset.width > asset.getWidth('detail') %} | |
{% do asset.setTransform('detail') %} | |
{% endif %} | |
<img src="{{ asset.url }}" alt="{{ asset.title }}"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment