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

<a class="c-button {buttonType} {buttonColor}" href="{link}" {f:if(condition: openLinkInNewWindow, then: 'target="_blank"')}>
    <f:render section="innerContent" arguments="{_all}" />
</a>

<f:section name="innerContent">
    <f:if condition="{neos:rendering.inBackend()}">
        <f:then>
            <neos:contentElement.wrap node="{node}">
                {neos:contentElement.editable(property: 'title', tag: 'span')}
            </neos:contentElement.wrap>
        </f:then>
        <f:else>
            <f:if condition="{title -> vh:string.notEmpty()}">
                {title -> f:format.raw()}
            </f:if>
        </f:else>
    </f:if>
</f:section>
