Using Assets, can I write a conditional which tests against the dimensions of an image? So as an example if an image height is >= 200px add this class, < 200px add that class.


Turns out this is the easiest thing in the world, and I'm a lazy lazy boy for asking before reading the documentation:

{assets_field} {if '{width'} >= '200px'} <img class="big-fella"> {if:else} <img class=""little-lad"> {/if} {/assets_field}

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.