templates/web/homepage/_new_publications.html.twig line 1

  1. {% block content %}
        <section class="bg-light py-lg-10 py-5">
            <div class="container">
                <h2 class="mb-5">{% trans %}nove.publikace{% endtrans %}</h2>
                <div class="publications">
                    {% for product in get_new_products() %}
                        <a href="{{ path('shop_product', {slug:product.slug}) }}" class="publication">
                            <div class="publication__cover">
                                {% if product.productVariants[0].productVariantUploadGroups|length > 0 %}
                                    {% if product.productVariants[0].productVariantUploadGroups[0].UploadGroup.upload|length > 0 %}
                                        <img alt="Foto produktu" src="{{ asset(get_upload_background(product.productVariants[0].productVariantUploadGroups[0].UploadGroup.upload[0])) }}" class="publication__image">
                                    {% else %}
                                        <img class="publication__image" src="{{ asset('build/img/mua-no-photo.jpg') }}" alt="Foto produktu">
                                    {% endif %}
                                {% else %}
                                    <img class="publication__image" src="{{ asset('build/img/mua-no-photo.jpg') }}" alt="Foto produktu">
                                {% endif %}                       </div>
                            <div class="publication__info">
                                <h3 class="publication__title">{{ product.productVariants[0].name }}</h3>
                                <p class="publication__author">{{ get_product_author(product.productVariants[0]) }}</p>
                            </div>
                        </a>
                    {% endfor %}
                </div>
            </div>
        </section>
    {% endblock %}