Wanted to do the following, I have 2 settings made for a slider on my website.
But I wanted one for mobile and one for desktop, however I thought the following (I'm an amateur developer, sorry if I have a lot of errors) I will use the {% if %} to distinguish the sizes.
When I did it at first, already loading the page at the defined size, it showed me the right banner, but then I went to reload the page with the screen already maximized, it was the same banner, I made some changes and the same thing, then I realized that the mobile does not rotate the images, but fixed, but which you can change.
But anyway, my question is, how do I use {% if width > 375px %} in my .tpl?
Code:
{% if width > 375 %}
{% for slide in settings.slider %}
<div class="swiper-slide slide-container">
{% if slide.link %}
<a href="{{ slide.link }}" aria-label="{{ 'Carrusel' | translate }} {{ loop.index }}" title="{{ slide.title }}">
{% endif %}
{% set has_text = slide.title or slide.description or slide.button %}
<div class="slider-slide">
<img {% if loop.first %}src="{{ slide.image | static_url | settings_image_url('1080p') }}" class="slider-image"{% else %}src="{{ slide.image | static_url | settings_image_url('tiny') }}" data-src="{{ slide.image | static_url | settings_image_url('1080p') }}" class="slider-image swiper-lazy blur-up-huge"{% endif %} alt="{{ slide.description }}">
</div>
{% if slide.link %}
</a>
{% endif %}
</div>
{% endfor %}
{% else %}
{% for slide in settings.slider_mobile %}
<div class="swiper-slide slide-container">
{% if slide.link %}
<a href="{{ slide.link }}" aria-label="Banner Rotativo Mobile {{ loop.index }}" title="{{ slide.title }}">
{% endif %}
{% set has_text = slide.title or slide.description or slide.button %}
<div class="slider-slide">
<img {% if loop.first %}src="{{ slide.image | static_url | settings_image_url('1080p') }}" class="slider-image"{% else %}src="{{ slide.image | static_url | settings_image_url('tiny') }}" data-src="{{ slide.image | static_url | settings_image_url('1080p') }}" class="slider-image swiper-lazy blur-up-huge"{% endif %} alt="{{ slide.description }}">
</div>
{% if slide.link %}
</a>
{% endif %}
</div>
{% endfor %}
{% endif %}