Applying CropResize to background image URL

Hi guys. I bet this will be pretty easy, but I can’t figure it out.
I am displaying an image as a background via in-line css.
Can someone tell me how to apply cropResize to that image before rendering it?

        {% for image in entry.images %} 
                <div class="projectimage" style="background: url('/{{ image.path }}');"></div>

Thank you!

{{ image.cropResize(300, 300).url }}
1 Like

Thank you very much!

Hm, this does not seem to work after all. That statement doesn’t output anything for me …

What is this entry exactly? If this refers to a page, you have to add media to it, exempla

{% for entry in page.children %}
{% for image in %
<div class="projectimage" style="background: url('{{ image.cropResize(300,300).url }}');"></div>
{% endfor %}
{% endfor %}
1 Like