This plugin is Address FieldType of the Japanese format for Craft CMS.
To install JP Address, follow these steps:
- Download & unzip the file and place the
jpaddress
directory into yourcraft/plugins
directory - -OR- do a
git clone https://github.com/dreamseeker/craft-jpaddress.git
directly into yourcraft/plugins
folder. You can then update it withgit pull
- Install plugin in the Craft Control Panel under Settings > Plugins
- The plugin folder should be named
jpaddress
for Craft to see it. GitHub recently started appending-master
(the branch name) to the name of the folder for zip file downloads.
JP Address works on Craft 2.6.x.
JP Address adds a 'JP Address' FieldType for Craft CMS that you can add to any of your Sections.
Create a JP Address field via Settings->Fields.
Once you have created the JP Address field, add it to your Section Entry Types, and fill in address information. Each address can contain Google Maps Coordinates.
[hint] You can change it in Settings->Plugins, if Google Maps Coordinates is unnecessary.
Google Maps API Key
can input in the same screen, too.
To display information about a jpaddress in your templates, you just use familiar Twig code. If the field handle for your JP Address field is "sampleAddress", this is what you'd use to output information about it.
- {{ entry.sampleAddress.postalCode }} - Postal code
- {{ entry.sampleAddress.prefecture }} - Name of prefectures
- {{ entry.sampleAddress.cityStreet }} - City name, Street Address (when
Use City Field?
setting is invalid.) - {{ entry.sampleAddress.city }} - City name (when
Use City Field?
setting is valid.) - {{ entry.sampleAddress.street }} - Street name (when
Use City Field?
setting is valid.) - {{ entry.sampleAddress.building }} - Building name, etc.
- {{ entry.sampleAddress.latitude }} - Latitude for Google Maps
- {{ entry.sampleAddress.longitude }} - Longitude for Google Maps
- {{ entry.sampleAddress.zoomLevel }} - Zoom Level for Google Maps
Some things to do, and ideas for potential features:
- For a list of Prefecture
- Add
Use City Field
in Settings->Plugins. If choose it, you can input city and street address at independent field. - Fixed a bug that can't view Google Maps when edit entry.
- Fixed a bug that can't set Google Maps Coordinates when create new entry in relatedTo modal window.
- Fixed a JavaScript error to occur when create new entry in relatedTo modal window.
- Fixed a JavaScript error to occur when you did not use Google Maps Coordinates.
- Update explanations of README.md
- Initial release
Brought to you by Toru Kokubun
To automatically insert the address according to the input of the postal code, we use the Ninton G.K.'s library.
https://github.com/ninton/jquery.jpostal.js/