{% extends "index" %}
{% if craft.app.language == 'de' %}
{% set title = "Themen" %}
{% elseif craft.app.language == 'en' %}
{% set title = "Topics" %}
{% endif %}
{% block content %}
<h1 class="maxWidthLimit mt32">{% if craft.app.language == 'de' %}Themen{% elseif craft.app.language == 'en' %}Topics{% endif %}</h1>
<div class="news mt16 maxWidthLimit">
    {% for newsElement in craft.entries.section('themen').all() %}
    {% set image = newsElement.image.one() %}
    <div class="wm-card wm-card--m" data-wm-card>
        <h3 class="wm-card__heading ">
            {% if newsElement.deactivateLinking.contains('yes') %}
            {{newsElement.title}}
            {% else %}
            <a href="{{newsElement.url}}" class="wm-card__link wm-link--unstyled ">
                {{newsElement.title}}
            </a>
            {% endif %}

        </h3>
        <div class="wm-card__media ">
            {% do image.setTransform({ height: 300 }) %}
            {{ tag('img', {
            src: image.url,
            width: image.width,
            height: image.height,
            srcset: image.getSrcset(['1.5x', '2x', '3x']),
            alt: image.title,
            }) }}
        </div>
        <div class="wm-card__content wm-rich-text ">
            {{ newsElement.teaser }}
        </div>
    </div>
    {% endfor %}
</div>
{% endblock %}