{% set blogLang = getLang(blog.getBlogLangs(), app.request) %}

{% if blogLang %}

{% if type is not defined %} {% set type = 'standart' %} {% endif %}
{% set link = path('blog_detail', {'alias': blogLang.alias}) %}

{% if type == 'main' %}
    {% set src = asset('img/blog/'~blog.image) %}
{% elseif type == 'central' %}
    {% if blog.verticalImage %}
        {% set src = asset('img/blog/'~blog.verticalImage) %}
    {% else %}
        {% set src = asset('img/blog/'~blog.image) %}
    {% endif %}
{% else %}
    {% set src = asset('img/blog/'~blog.thumbnailImage) %}
{% endif %}


    <a href="{{ link }}" class="blog-item {{ type }}" title="{{ blogLang.title }}">
        <div class="blog-img"><img class="blog-img" src="{{ src }}" alt="{{ blogLang.title }}" title="{{ blogLang.title }}"></div>
        <div class="blog-item-content">
            {% if blog.tagIdentifierArray %}
                <div class="tag-container">
                    {% for tag in blog.tagIdentifierArray %}
                        <div class="tag blog-tag">{{ blogTags[(tag)] }}</div>
                    {% endfor %}
                </div>
            {% endif %}
            <div class="blog-title">{{ blogLang.title }}</div>
            {% if blog.createdAt is defined %}
                {% set date = blog.createdAt|date("d F Y")|split(' ') %}
                {% set date = date[0] ~ " " ~ date[1]|lower|trans ~ " " ~ date[2] %}
                <div class="blog-date">{{date}}</div>
            {% endif %}
        </div>
    </a>
{% endif %}