Skip to the content
Documentation

Get image width in Foreach loop

No ratings yet

Thanks Lukasz, for this answer on extracting an image width (useful for defining the width of a parent container in css).
<div class="picleft" style="width:{$related.data_map.picture.content[portrait].width}px>
{attribute_view_gui attribute=$related.data_map.picture image_class=portrait}
</div>
Gives you an image wrapped in a div of the same width as the image.
'portrait' is the image alias.