The only address field you need
This plugin requires Craft CMS 3.0.0-RC1 or later.
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require studioespresso/craft-easyaddressfield
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for "Easy Address Field".
You can access the values from your address field in Twig through the following variables:
field.name
field.street
field.street2
field.postalCode
field.state
field.country // returns the country code
field.getCountryName(craft.app.locale) // returns the coutry's full name, in the country's locale
field.latitude
field.longitude
field.getDirectionsUrl() // get a directions link to the given address
If you're using the getDirectionsUrl()
function on craft.address
, you'll now need to call the function on the field itself instead of the on the plugin's Twig variable.
These functions have been removed from the plugin, you'll need to replace these yourself.