{namespace vh=Newland\NeosViewHelpers\ViewHelpers}

<a
    data-toubiz-gallery-item
    href="{item.sourceUri}"
    data-sub-html="{vh:render(section: 'SubHtml', arguments: '{item: item}') -> f:format.htmlentities()}"
    class="tb-gallery-preview__link"
    itemprop="image"
    itemscope
    itemtype="http://schema.org/ImageObject">

    <img
        data-src="{item.sourceUri}"
        alt="{item.title}"
        class="tb-gallery-preview__image lazyload"
        itemprop="image url" />

    <f:if condition="{caption}">
        <div class="tb-gallery-preview__caption">
            <p class="text-sm">
                <f:if condition="{item.title}">
                    {item.title}
                    <br />
                </f:if>
                <vh:render section="Copyright" arguments="{copyright: item.copyright}" />
            </p>
        </div>
    </f:if>
</a>

<f:section name="SubHtml">
    <p>
        {item.title}
        <vh:render section="Copyright" arguments="{copyright: item.copyright}" />
    </p>
</f:section>

<f:section name="Copyright">
    <f:if condition="{copyright}">
        <span class="text-xs">
            © <span itemprop="copyrightHolder">{copyright}</span>
        </span>
    </f:if>
</f:section>
