Skip to content

Twig

phil/address-bundle
NameKindGives
address(locale = null)filterThe address on its lines, joined by line breaks — `
address_lines(locale = null)filterThe lines
address_label(origin, locale = null)filterThe address for a postal label sent from a country
country_name(code, locale = null)functionThe country's name

The language is the request's unless one is given: in Japanese, a Japanese address takes its own format.

schema.org

FunctionGives
address_schema(address)The address as a schema.org PostalAddress, or null

The data composes into a JSON-LD document printed by the template:

<script type="application/ld+json">{{ data|json_encode(constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_UNESCAPED_UNICODE') b-or constant('JSON_HEX_TAG'))|raw }}</script>

JSON_HEX_TAG writes < and > as escapes, so no value can close the script element.