Hello all,
I am trying to use MX_Calc to do some basic math on a custom field (columns) to calculate the corresponding width of an image that I am passing to ED_ImageResizer.
ED_ImageResizer doesn’t output a new image though, it outputs the original uploaded image. When I replace the maxWidth parameter value with an explicit declaration it does output a sized and cached image.
I’ve also tried enabling PHP support on the template and executing the math functions that way…same result.
The truly odd thing is that if I set the class parameter using some match functions as well, it works properly.
Any ideas?
<div class="row">
{exp:channel:entries channel="promotions" url_title="home-page-promotions"}
{promotions}
{if promo_active == "Yes"}
<div class="span{exp:mx_calc expression='{promo_columns}*2'}">
{exp:ed_imageresizer
image="{promo_image}"
maxWidth="{exp:mx_calc expression='({promo_columns}*60)+({promo_columns}*140)-30'}"
maxHeight="150"
cropratio="{exp:mx_calc expression='({promo_columns}*60)+({promo_columns}*140)-30'}:150"
alt="{promo_title}"
class="span{exp:mx_calc expression='{promo_columns}*2'}"
}
</div>
{/if}
{/promotions}
{/exp:channel:entries}
</div>