address-plain.html.twig 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {#
  2. /**
  3. * @file
  4. * Default template for the 'plain' address formatter.
  5. *
  6. * Available variables:
  7. * - given_name: Given name.
  8. * - additional_name: Additional name.
  9. * - family_name: Family name.
  10. * - organization: Organization.
  11. * - address_line1: First address line.
  12. * - address_line2: Second address line.
  13. * - postal_code: Postal code.
  14. * - sorting_code: Sorting code.
  15. * - dependent_locality: The dependent locality.
  16. * - dependent_locality.code: Dependent locality code.
  17. * - dependent_locality.name: Dependent locality name.
  18. * - locality: The locality subdivision.
  19. * - locality.code: Locality code.
  20. * - locality.name: Locality name.
  21. * - administrative_area: The administrative area subdivision.
  22. * - administrative_area.code: Administrative area code.
  23. * - administrative_area.name: Administrative area name.
  24. * - country: The country.
  25. * - country.code: Country code.
  26. * - country.name: Country name.
  27. * - address: An object that implements \Drupal\address\AddressInterface
  28. * representing the address to be rendered. Only public methods can be used.
  29. * - view_mode: View mode of the entity being rendered that this address field
  30. * is attached to. For example, "teaser" or "full".
  31. *
  32. * if a subdivision (dependent_locality, locality, administrative_area) was
  33. * entered, the array will always have a code. If it's a predefined subdivision,
  34. * it will also have a name. The code is always preferred.
  35. *
  36. * @ingroup themeable
  37. */
  38. #}
  39. <p class="address" translate="no">
  40. {% if given_name or family_name %}
  41. <span class=""> {{ given_name }} {{ family_name }} </span><br>
  42. {% endif %}
  43. {% if organization %}
  44. <span class="">{{ organization }}</span><br>
  45. {% endif %}
  46. {% if address_line1 %}
  47. <span class=""> {{ address_line1 }} </span><br>
  48. {% endif %}
  49. {% if address_line2 %}
  50. <span class="">{{ address_line2 }} </span><br>
  51. {% endif %}
  52. {% if dependent_locality.code %}
  53. <span class="locality"> {{ dependent_locality.code }} </span><br>
  54. {% endif %}
  55. {% if locality.code or postal_code or administrative_area.code %}
  56. <span class="postal-code"> {{ locality.code }} {{ postal_code }} {{ administrative_area.code }} </span><br>
  57. {% endif %}
  58. <span class="country">{{ country.name }}</span>
  59. </p>