{% load wagtailimages_tags wagtailcore_tags %} {% if request.user_agent.is_pc and value.bg_desktop %}
{% for media in value.bg_desktop %}
= 2 and not amp or forloop.counter0 > 0 and not amp %}data-src="{{ media.value.url }}" {% else %}style="background-image: url({{ media.value.url }})"{% endif %} {% elif media.block_type == 'image' %} {% image media.value width-1920 as img %} {% if block_num >= 2 and not amp or forloop.counter0 > 0 and not amp %}data-src="{{ img.url }}" {% else %}style="background-image: url({{ img.url }})"{% endif %} {% endif %} >
{% endfor %}
{% endif %} {% if not request.user_agent.is_pc and value.bg_mobile %}
{% for media in value.bg_mobile %}
= 2 and not amp or forloop.counter0 > 0 and not amp %}data-src="{{ media.value.url }}" {% else %}style="background-image: url({{ media.value.url }})"{% endif %} {% elif media.block_type == 'image' %} {% image media.value width-600 as img %} {% if block_num >= 2 and not amp or forloop.counter0 > 0 and not amp %}data-src="{{ img.url }}" {% else %}style="background-image: url({{ img.url }})"{% endif %} {% endif %} >
{% endfor %}
{% endif %}