2017 © Pedro Peláez
 

neos-package neos-addresseditor

Simple Neos extension adding a custom property editor for addresses, including GeoCoding

image

wwwision/neos-addresseditor

Simple Neos extension adding a custom property editor for addresses, including GeoCoding

  • Friday, May 26, 2017
  • by bwaidelich
  • Repository
  • 1 Watchers
  • 1 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Wwwision.Neos.AddressEditor

Simple Neos extension adding a custom property editor for postal addresses and GeoCoding support, (*1)

Features

This package comes with two main features:, (*2)

  1. A custom property editor for PostalAddress-properties
  2. A GeoCoding service that can look up GeoCoordinates by Postal- and IP Addresses (based on the great willdurand/geocoder package)

Usage

Install the package using composer:, (*3)

composer require wwision/neos-addresseditor:^1.0

After successful installation you should configure a Google Maps API key:, (*4)

Wwwision:
  Neos:
    AddressEditor:
      googleMapsApiKey: '<VALID_GOOGLE_MAPS_API_KEY>'

(For testing purposes you should be able to skip that step), (*5)

To make use of the new Property Editor, just add a property of PostalAddress to any NodeType configuration:, (*6)

'Some.Package:SomeNodeType':
  # ...
  properties:
    'someProperty':
      type: 'Wwwision\Neos\AddressEditor\PostalAddress'

Afterwards you should be able to see the new PostalAddressEditor in the Neos Backend:, (*7)

Screenshot expanded editor Screenshot collapsed editor, (*8)

Note: The green checkmark indicates that the geocoding for this address has been successful, (*9)

Display coordinates

When the geocoding was successful you can access the coordinates via the longitude and latitude fields of the address property. With a little bit of Fusion code you can make these available within a template (i.e. for rendering them in a Map):, (*10)

prototype(Some.Package:SomeNodeType) < prototype(Neos.Fusion:Template) {
    templatePath = 'resource://Some.Package/Private/Templates/FusionObjects/Map.html'

    address = ${q(node).property('address')}
}

In the Fluid template you can then access the coordinates like this:, (*11)

<f:if condition="{address}">
    <span class="marker" data-latitude="{address.latitude}" data-longitude="{address.longitude}">{address}</span>
</f:if>

License

Licensed under MIT, see LICENSE, (*12)

The Versions

26/05 2017

dev-master

9999999-dev

Simple Neos extension adding a custom property editor for addresses, including GeoCoding

  Sources   Download

MIT

The Requires

 

26/05 2017

v1.0.2

1.0.2.0

Simple Neos extension adding a custom property editor for addresses, including GeoCoding

  Sources   Download

MIT

The Requires

 

07/03 2017

v1.0.1

1.0.1.0

Simple Neos extension adding a custom property editor for addresses, including GeoCoding

  Sources   Download

MIT

The Requires

 

07/03 2017

v1.0.0

1.0.0.0

Simple Neos extension adding a custom property editor for addresses, including GeoCoding

  Sources   Download

The Requires