{namespace neos=Neos\Neos\ViewHelpers}
{namespace vh=Newland\NeosViewHelpers\ViewHelpers}

<f:if condition="{neos:rendering.inBackend()}">
    <f:then>
        <div class="c-grid-partner-logo">
            <f:render section="gridPartnerLogoContent"></f:render>
        </div>
    </f:then>
    <f:else>
        <f:if condition="{link}">
            <f:then>
                <a
                    href="{link}"
                    title="{linkTitle}"
                    class="c-grid-partner-logo"
                    {f:if(condition: openLinkInNewWindow, then: 'target="_blank" rel="noopener noreferrer"')}
                >
                   <f:render section="gridPartnerLogoContent"></f:render>
                </a>
            </f:then>
            <f:else>
                <div class="c-grid-partner-logo">
                    <f:render section="gridPartnerLogoContent"></f:render>
                </div>
            </f:else>
        </f:if>
    </f:else>
</f:if>

<f:section name="gridPartnerLogoContent">
    <f:if condition="{logo}">
        <img
            data-src="{neos.media:uri.image(image: logo, maximumWidth: 496, maximumHeight: 120)}"
            alt="{alternativeText}"
            height="60"
            class="c-grid-partner-logo__image lazyload"
        >

        {neos:contentElement.editable(property: 'subline', class: 'c-partner-logo__subline', tag: 'p')}
    </f:if>
</f:section>
