10

Product support

Visit this product's website for support.

  • Added on Sep 25, 2015
  • Current version: 2.0.0
  • Platform Compatibility
    v3.x use latest
    v2.x 1.2
    v1.x 1.2
  • Extensions: 18
  • Created by
  • Public repository

Categories

This plugin adds location based features to OctoberCMS.

  • Easily add Country and State to any model
  • Form widget for address lookups (Google API)

Extended features

To integrate locations with front-end users consider installing the User Plus+ plugin (RainLab.UserPlus).

Google API key requirement

As of June 22, 2016 the Google Maps service requires an API key. You may generate a key from the following link:

Copy the key and enter it in the Settings > Location settings area. If you find the address finder is not working, you may need to enable the Places Web Service.

The following plugins extend or depend on the plugin
Profile
$10

Profile

Social information, User directory, V-Card downloading, Avatar gallery, Frontend profile forms.

74 projects
# 49 in Paid of all time.
$10

Profile

Social information, User directory, V-Card downloading, Avatar gallery, Frontend profile forms.

User Plus+
Free

User Plus+

Adds extra features to the User plugin.

20,678 installations
# 12 in Free of all time.
Free

User Plus+

Adds extra features to the User plugin.

Location Towns
Free

Location Towns

Adds Towns to Location plugin.

732 installations
# 387 in Free of all time.
Free

Location Towns

Adds Towns to Location plugin.

Pay
Free

Pay

Invoicing and Accounting

5,193 installations
# 134 in Free of all time.
Free

Pay

Invoicing and Accounting

Cumulus Core
Free

Cumulus Core

The heart and start point of any Cumulus application

748 installations
# 145 in Free of all time.
Free

Cumulus Core

The heart and start point of any Cumulus application

TechMarket
Free

TechMarket

Required by TechMarket E-Commerce theme

236 installations
# 488 in Free of all time.
Free

TechMarket

Required by TechMarket E-Commerce theme

CRM Pro
$50

CRM Pro

The professional Customer Relations Manager (CRM) for October

35 projects
# 110 in Paid of all time.
$50

CRM Pro

The professional Customer Relations Manager (CRM) for October

Mall
Free

Mall

E-commerce shop solution for October CMS

10,759 installations
# 21 in Free of all time.
Free

Mall

E-commerce shop solution for October CMS

Pyrolancer
$397

Pyrolancer

A freelance marketplace for online and remote workers.

51 projects
# 207 in Paid of all time.
$397

Pyrolancer

A freelance marketplace for online and remote workers.

LeafletPro
Free

LeafletPro

Embed a Leaflet map (OpenStreetMap) with ease

562 installations
# 212 in Free of all time.
Free

LeafletPro

Embed a Leaflet map (OpenStreetMap) with ease

Job applications management
$10

Job applications management

Simple and powerful plugin to setup job listings on your website

17 projects
# 98 in Paid of all time.
$10

Job applications management

Simple and powerful plugin to setup job listings on your website

TPV Virtual Payment Gateway
Free

TPV Virtual Payment Gateway

This Plugin is Payment Gateway addon for JKshop Plugin

115 installations
# 744 in Free of all time.
Free

TPV Virtual Payment Gateway

This Plugin is Payment Gateway addon for JKshop Plugin

Places
Free

Places

Display your posts on Google Map and create beautiful listing pages

136 installations
# 603 in Free of all time.
Free

Places

Display your posts on Google Map and create beautiful listing pages

Careers
$10

Careers

Posting Job for your organization made simple.

37 projects
# 55 in Paid of all time.
$10

Careers

Posting Job for your organization made simple.

Let's rent
$25

Let's rent

The core component for building a rental database

3 projects
# 115 in Paid of all time.
$25

Let's rent

The core component for building a rental database

Job Portal
$10

Job Portal

Create your very own job portal and connect employers and talents

4 projects
# 162 in Paid of all time.
$10

Job Portal

Create your very own job portal and connect employers and talents

Attributize Location
Free

Attributize Location

RainLab Location integration for Sixgweb Attributize Plugin

12 installations
# 601 in Free of all time.
Free

Attributize Location

RainLab Location integration for Sixgweb Attributize Plugin

Online Campus
$79

Online Campus

Online Courses for October CMS

4 projects
# 80 in Paid of all time.
$79

Online Campus

Online Courses for October CMS

The following themes use this plugin

Add Country and State to any model

This plugin provides an easy way to add location fields, country and state, to any model. Simply add these columns to the database table:

$table->integer('country_id')->unsigned()->nullable()->index();
$table->integer('state_id')->unsigned()->nullable()->index();

Then implement the RainLab.Location.Behaviors.LocationModel behavior in the model class:

public $implement = ['RainLab.Location.Behaviors.LocationModel'];

This will automatically create two "belongs to" relationships:

  1. state - relation for RainLab\Location\Models\State
  2. country - relation for RainLab\Location\Models\Country

Back-end usage

Forms

You are free to add the following form field definitions:

country:
    label: rainlab.location::lang.country.label
    type: dropdown
    span: left
    placeholder: rainlab.location::lang.country.select

state:
    label: rainlab.location::lang.state.label
    type: dropdown
    span: right
    dependsOn: country
    placeholder: rainlab.location::lang.state.select

Lists

For the list column definitions, you can use the following snippet:

 country:
     label: rainlab.location::lang.country.label
     searchable: true
     relation: country
     select: name
     sortable: false

 state:
     label: rainlab.location::lang.state.label
     searchable: true
     relation: state
     select: name
     sortable: false

Front-end usage

The front-end can also use the relationships by creating a partial called country-state with the content:

{% set countryId = countryId|default(form_value('country_id')) %}
{% set stateId = stateId|default(form_value('state_id')) %}

<div class="form-group">
    <label for="accountCountry">Country</label>
    {{ form_select_country('country_id', countryId, {
        id: 'accountCountry',
        class: 'form-control',
        emptyOption: '',
        'data-request': 'onInit',
        'data-request-update': {
            'country-state': '#partialCountryState'
        }
    }) }}
</div>

<div class="form-group">
    <label for="accountState">State</label>
    {{ form_select_state('state_id', countryId, stateId, {
        id: 'accountState',
        class: 'form-control',
        emptyOption: ''
    }) }}
</div>

This partial can be rendered in a form with the following:

<div id="partialCountryState">
    {% partial 'country-state' countryId=user.country_id stateId=user.state_id %}
</div>

Short code accessors

The behavior will also add a special short code accessor and setter to the model that converts country_code and state_code to their respective identifiers.

// Softly looks up and sets the country_id and state_id
// for these Country and State relations.

$model->country_code = "US";
$model->state_code = "FL";
$model->save();

Address Finder Form Widget

This plugin introduces an address lookup form field called addressfinder. The form widget renders a Google Maps autocomplete address field that automatically populates mapped fields based on the value entered and selected in the address.

Available mappings:

  • street
  • city
  • zip
  • state
  • country
  • country-long
  • latitude
  • longitude
  • vicinity

Usage:

# ===================================
#  Form Field Definitions
# ===================================

fields:
    address:
        label: Address
        type: addressfinder
        fieldMap:
            latitude: latitude
            longitude: longitude
            city: city
            zip: zip
            country: country_code
            state: state_code
            vicinity: vicinity

    city:
        label: City
    zip:
        label: Zip
    country_code:
        label: Country
    state_code:
        label: State
    latitude:
        label: Latitude
    longitude:
        label: Longitude
    vicinity:
        label: Vicinity
  • Found the plugin useful on 20 Jan, 2020

    how I can this component several time in one page?

  • Found the plugin useful on 25 Jan, 2017

    Great plugin! Using it on my new project and I find it the best in October CMS marketplace yet.

  • Found the plugin useful on 3 Jan, 2016

    Thanks Master :D

2.0.0

Major Upgrade to Location Plugin

May 06, 2024

1.2.5

Fixes missing callback parameter on Google API

Feb 28, 2023

1.2.4

Adds reverseStreetNumber option to address finder

Nov 26, 2022

1.2.3

Improve support with October v3

May 13, 2022

1.2.2

Include Russian states

Apr 27, 2022

1.2.1

Add country calling codes

Oct 02, 2021

1.2.0

Fixes checkboxes in settings pages

Aug 27, 2021

1.1.6

Added ability to disable specific states

Dec 17, 2020

1.1.5

Include Italian states (province)

Jul 19, 2019

1.1.4

Added support for UK counties

Jul 09, 2019

1.1.3

Include Argentina states

Feb 01, 2019

1.1.2

Yet another change to the AddressFinder for changes to the FormField API

Jan 10, 2019

1.1.1

Minor fix to AddressFinder formwidget for the change to the FormField API

Jan 10, 2019

1.1.0

!!! Update requires Build 447. Fixed AddressFinder form widget not working correctly in repeaters.

Jan 10, 2019

1.0.8

Include Mexico states

Oct 05, 2018

1.0.7

Added basic geocoding method to the Country model.

Sep 15, 2016

1.0.6

Added support for defining a default country and state.

Sep 03, 2016

1.0.5

Countries can now be pinned to make them appear at the top of the list.

Aug 30, 2016

1.0.4

Satisfy the new Google API key requirement.

Jul 08, 2016

1.0.3

Add seed data for countries and states.

Sep 25, 2015

1.0.2

Create database tables.

Sep 25, 2015

1.0.1

Initialize plugin.

Sep 25, 2015