{% extends '@SonataAdmin/CRUD/base_list_field.html.twig' %}

{% block field %}
{% if object is defined %}
    <div style="width:320px; display:flex; justify-content:space-between; flex-wrap:wrap">
        {%  if attribute(object, 'ytLink') is not empty %}
            <a href="{{ attribute(object, 'ytLink') }}" target="_blank"><img src="https://img.youtube.com/vi/{{ attribute(object, 'ytId') }}/maxresdefault.jpg" alt="" style="max-width: 100%;" ></a>
        {% endif %}
        
    </div>
            
{% endif %}
{% endblock %}