plugin.tx_ttaddress_pi1 = USER
plugin.tx_ttaddress_pi1 {
    userFunc = tx_ttaddress_pi1->main

    templatePath = fileadmin/templates/seralea/Extensions/tt_address/
    defaultTemplateFileName = default_hcard.htm
    pidList = 0
    recursive = 0
    sortByColumn = name
    sortOrder = ASC
    listMaxItems = 0

    templates.default {
        # supports the hcard microformats standard

        image {
            params = class="photo" style="float:left; margin-right:4px"
            altText = Photo of {field:first_name} {field:middle_name} {field:last_name}
            altText.insertData = 1
            titleText = {field:first_name} {field:middle_name} {field:last_name}
            titleText.insertData = 1
            debugData = 1
        }



        title {
            innerWrap = <span class="address-title" itemprop="jobTitle">|</span>
        }

        first_name {
            innerWrap = <span class="address-name" itemprop="name">|
            innerWrap.if.isFalse.field = middle_name
            innerWrap2 = <span class="given-name">|</span>
            innerWrap2.if.isTrue.field = middle_name
            outerWrap = <span class="fn n">|
            outerWrap.if.isTrue.field = middle_name
        }

        middle_name.wrap = <span class="additional-name">|</span>
        middle_name.required = 1

        last_name {
            innerWrap = |</span>
            innerWrap.if.isFalse.field = middle_name
            innerWrap2 = <span class="family-name">|</span>
            innerWrap2.if.isTrue.field = middle_name
            outerWrap = |</span>
            outerWrap.if.isTrue.field = middle_name
        }


        description {
            #wird als Feld für Praxis mit mehreren Operateuren missbraucht :)
            outerWrap = <br>|
            outerWrap.if.isTrue.field = description
        }

        organization {
            wrap = <div class="address-organisation" itemprop="name">|</div>
            required = 1
        }

        email {
            typolink.parameter.field = email
            typolink.ATagParams = class="address-email" itemprop="email"
#            outerWrap = |<br>
            outerWrap.if.isTrue.field = www
            required = 1
        }

        address {
            wrap = <span class="address-street" itemprop="streetAddress">|</span>
            outerWrap = |<br>
            br = 1
            required = 1
        }

        city {
            wrap = <span class="address-locality" itemprop="addressLocality">|</span>
            required = 1
#            outerWrap = ,|
#            outerWrap.if.isTrue.field = region
        }

        region {
            wrap = <span class="address-region" itemprop="addressRegion">|</span>
            required = 1
            outerWrap = |
            outerWrap.if.isTrue.field = zip
        }

        zip {
            noTrimWrap = | <span class="address-zip" itemprop="postalCode">|</span>|
            required = 1
            outerWrap = |
            outerWrap.if.isFalse.field = region
        }

        country {
            wrap = <span class="address-country sr-only">|</span>
            outerWrap = |<br>
            required = 1
        }

        phone {
            wrap = <span class="address-telephone" itemprop="telephone">|</span>
            required = 1
#            outerWrap = |<br>
        }

        mobile {
            wrap = <span class="address-mobile" itemprop="telephone">|</span>
#            outerWrap = |<br>
            required = 1
        }

        fax {
            wrap = <span class="address-telefax" itemprop="faxNumber">|</span>
#            outerWrap = |<br>
            required = 1
        }

        subparts {
            adr.hasOneOf = address, city, region, zip, country
            url.typolink {
                parameter.field = www
                target =
                ATagParams = class="address-website" itemprop="url"

            }
        }
    }
}
