{namespace media=Neos\Media\ViewHelpers}
{namespace neos=Neos\Neos\ViewHelpers}

<f:alias
    map="{
        smallImage: '{neos.media:uri.image(image: image, maximumWidth: 750) -> f:if(condition: image)}',
        mediumImage: '{neos.media:uri.image(image: image, maximumWidth: 960) -> f:if(condition: image)}',
        largeImage: '{neos.media:uri.image(image: image, maximumWidth: 1600) -> f:if(condition: image)}',
        fullImage: '{neos.media:uri.image(image: image) -> f:if(condition: image)}'
    }">

    <f:if condition="{neos:rendering.inBackend()}">
        <f:then>
            <div class="o-grid__item m-0 p-0">
                <img src="{fullImage}" alt="{alternativeText}">

                <f:render partial="Copyright" arguments="{_all}"></f:render>
            </div>
        </f:then>
        <f:else>
            <a
                data-toubiz-gallery-item
                href="{fullImage}"
                data-responsive="{smallImage} 750, {mediumImage} 960, {largeImage} 1600"
                data-sub-html="{caption}"
                class="tb-swiper__slide">

                <img
                    data-src="{mediumImage}"
                    class="tb-swiper__slide-img tb-swiper__slide-img-height lazyload"
                    alt="{alternativeText}">

                <noscript>
                    <img src="{fullImage}" alt="{alternativeText}">
                </noscript>

                <f:render partial="Copyright" arguments="{_all}"></f:render>
            </a>
        </f:else>
    </f:if>
</f:alias>


