You are here

public static function AddressDisplayFormatter::defaultSettings in Address Display 8

Defines the default settings for this plugin.

Return value

array A list of default settings, keyed by the setting name.

Overrides PluginSettingsBase::defaultSettings

File

src/Plugin/Field/FieldFormatter/AddressDisplayFormatter.php, line 26

Class

AddressDisplayFormatter
Plugin implementation of the 'Address Display' formatter.

Namespace

Drupal\address_display\Plugin\Field\FieldFormatter

Code

public static function defaultSettings() {
  $settings = [
    'address_display' => [
      'organization' => [
        'display' => TRUE,
        'glue' => '',
        'weight' => -1,
      ],
      'address_line1' => [
        'display' => TRUE,
        'glue' => '',
        'weight' => 0,
      ],
      'address_line2' => [
        'display' => TRUE,
        'glue' => ',',
        'weight' => 1,
      ],
      'locality' => [
        'display' => TRUE,
        'glue' => ',',
        'weight' => 2,
      ],
      'postal_code' => [
        'display' => TRUE,
        'glue' => '',
        'weight' => 3,
      ],
      'country_code' => [
        'display' => TRUE,
        'glue' => '',
        'weight' => 4,
      ],
      'langcode' => [
        'display' => FALSE,
        'glue' => ',',
        'weight' => 100,
      ],
      'administrative_area' => [
        'display' => FALSE,
        'glue' => ',',
        'weight' => 100,
      ],
      'dependent_locality' => [
        'display' => FALSE,
        'glue' => ',',
        'weight' => 100,
      ],
      'sorting_code' => [
        'display' => FALSE,
        'glue' => ',',
        'weight' => 100,
      ],
      'given_name' => [
        'display' => TRUE,
        'glue' => '',
        'weight' => 100,
      ],
      'family_name' => [
        'display' => TRUE,
        'glue' => ',',
        'weight' => 100,
      ],
    ],
  ];
  return $settings + parent::defaultSettings();
}