{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>

        <f:for each="{article.addresses}" as="address">
            <div
                class="tb-contact mt-2"
                itemprop="address"
                itemscope
                itemtype="http://schema.org/PostalAddress">

                <p class="tb-contact__address">
                    <strong>{address.name}</strong><br />
                    <f:if condition="{address.street}">
                        <span itemprop="streetAddress">{address.street}</span><br />
                    </f:if>
                    <span itemprop="postalCode">{address.zip}</span>
                    <span itemprop="addressLocality">{address.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>
            </div>
        </f:for>
    </div>
</poi:collection.attributes.notAllEmpty>
