{namespace poi=Newland\Toubiz\Poi\Neos\ViewHelpers}
{namespace vh=Newland\NeosViewHelpers\ViewHelpers}

<poi:collection.attributes.notAllEmpty objects="{article.addresses}">
    <div class="mb-8">
        <h2 class="mt-0 mb-2 text-xl">
            {sectionHeadline}
        </h2>
        <div 
            class="tb-contact"
            itemprop="address"
            itemscope
            itemtype="http://schema.org/PostalAddress">
            
            <f:alias map="{address: article.addresses.0}">
                <p class="tb-contact__address">
                    <strong>{address.name}</strong><br />
                    <f:if condition="{address.street}">
                        <span itemprop="streetAddress">{article.mainAddress.street}</span><br />
                    </f:if>
                    <span itemprop="postalCode">{article.mainAddress.zip}</span>
                    <span itemprop="addressLocality">{article.mainAddress.city}</span>
                </p>

                <p class="tb-contact__telco">
                    <f:if condition="{address.phoneNumber}">
                        {vh:translate(id: 'contact.property.phoneNumber', package: 'Newland.Toubiz.Poi.Neos', source: 'Views/Show')}
                        <span itemprop="telephone">{address.phoneNumber}</span><br>
                    </f:if>
                    <f:if condition="{address.faxNumber}">
                        {vh:translate(id: 'contact.property.faxNumber', package: 'Newland.Toubiz.Poi.Neos', source: 'Views/Show')}
                        <span itemprop="faxNumber">{address.faxNumber}</span><br>
                    </f:if>
                    <f:if condition="{address.emailAddress}">
                        <a class="tb-contact__link" href="mailto:{address.emailAddress}" itemprop="email">
                            {address.emailAddress}
                        </a>
                    </f:if>
                    <f:if condition="{address.websiteAddress}">
                        <a class="tb-contact__link" href="{address.websiteAddress}" target="_blank" itemprop="url">
                            {address.websiteAddress}
                        </a>
                    </f:if>
                </p>
            </f:alias>
        </div>
    </div>
</poi:collection.attributes.notAllEmpty>
