This project is not covered by Drupal’s security advisory policy.

Address Field module provide default API to store compatible xNAL standard postal address.
However, some fields are not completely implemented such as "sub premise" which is sometimes used a the third street address field.

Thanks to plugin API, Address Field Sub Premise provides the missing part.

Setup

This module provide the missing form element.
However, you still need to alter country form declaration to specify which country should display this new field, and which one requires it.

  • Install and enable this module
  • Create a new field using the Address Field module(is necessary)
  • In this setup field, enable the "Address form (country specific)"
  • In this setup field, enable the "Address form extension (sub premise field support)" plugin
  • Create a hook as followed
/**
 * Implements hook_addressfield_address_formats_alter().
 */
function example_addressfield_address_formats_alter(&$address_formats) {
  // Enable 'sub_premise' field.
  $address_formats['US']['used_fields'][] = 'sub_premise';
  // Set 'sub_premise' field as required.
  $address_formats['US']['required_fields'][] = 'sub_premise';
  // Set label.
  $address_formats['US']['sub_premise_label'] = t('Address 3');
}

Compatibility notes

This module doesn't alter database schema. All necessary fields are already available via Address Field module.

Supporting organizations: 

Project information

Releases