{namespace neos=Neos\Neos\ViewHelpers}
{namespace media=Neos\Media\ViewHelpers}
<f:if condition="{image}">
    <f:then>
        <f:if condition="{link}">
            <f:then>
                <a href="{link}">
                    <f:render section="imageRendering" arguments="{_all}" />
                </a>
            </f:then>
            <f:else>
                <f:render section="imageRendering" arguments="{_all}" />
            </f:else>
        </f:if>
    </f:then>
    <f:else>
        <f:if condition="{neos:rendering.inEditMode()}">
            <img src="{f:uri.resource(package: 'Neos.Neos', path: 'Images/dummy-image.svg')}"
                 alt="Dummy image"
                 class="neos-handle" />

        </f:if>
    </f:else>
</f:if>

<f:section name="imageRendering">
    <noscript>
        <media:image image="{image}"
                     alt="{alternativeText}"
                     width="{width}"
                     maximumWidth="{maximumWidth}"
                     height="{height}"
                     maximumHeight="{maximumHeight}"
                     allowUpScaling="{allowUpScaling}"
                     allowCropping="{allowCropping}"
                     class="c-image__image" />

    </noscript>

    <img data-src="{media:uri.image(image: image, allowCropping: allowCropping, allowUpScaling: allowUpScaling, height: height, maximumHeight: maximumHeight, maximumWidth: maximumWidth)}"
         class="c-image__image lazyload"
         alt="{alternativeText}" />

</f:section>
