Skip to main content
drupalreleases
Release: Cms 2.2.3 — Update released for Drupal core (2.2.3)! Release: Easy Breadcrumb 2.0.11 — Minor update available for module easy_breadcrumb (2.0.11). Release: Bootstrap 8.x-3.42 — Minor update available for theme bootstrap (8.x-3.42). Release: Editoria11y Accessibility Checker 3.0.10 — Minor update available for module editoria11y (3.0.10). Release: Editoria11y Accessibility Checker 2.2.24 — Minor update available for module editoria11y (2.2.24). Release: Leaflet 10.4.13 — Minor update available for module leaflet (10.4.13). Release: Flag 5.1.1 — Minor update available for module flag (5.1.1). Release: Layout Paragraphs 3.0.0-beta5 — New beta version released for module layout_paragraphs (3.0.0-beta5). Module Revived: Bootstrap 8.x-3.41 — Theme bootstrap updated after 6 months of inactivity (8.x-3.41). Security Coverage: Component Library — Module component_library now has official Drupal security advisory coverage.

Location Selector

30 sites Security covered Drupal 8–11
View on drupal.org

This module allows you to assign content to specific locations using a hierarchical selection system. It leverages the GeoNames API to provide a vast, multilingual database of locations, offering better performance and scalability than standard taxonomy systems.

Do you want to assign the content of your website to one or more locations? Then this module is perfect for you.

Why this module?

In the beginning, I used Taxonomies for doing so. But there are multiple problems with Taxonomies:

  • Selection
    • The selection of hierarchical terms are not well supported. Tough SHS and CSHS Module (maybe one day HS) solve this problem, but the maintenance is not satisfactory.
  • Too much data
    • The world is big. If you want many countries, or even continents to choose from, your taxonomy vocabularies get way to big and you have to import everything and maintain it yourself.
  • Perfomance
    • If you store much data, then the current taxonomy modules fail completely. Your website is crashing. Even with caching inserted, writing to the cache pushes the system to its limits.

Why GeoNames?

The solution is to use a Location API instead of taxonomies. Google API has a price program, and is no longer free at a certain point. GeoNames on the other hand has a Creative Commons Attribution 4.0 License and a huge location database too. So in my opinion it's the better deal.
Theorethically, the module can be further developed for further APIs in the future.

How to use

  1. Install the module like every normal module.
  2. Go to www.geonames.org/login and create a free account for limitless API access. See also: www.geonames.org/export/web-services for more information.
  3. Go to /admin/config/location_selector/settings and enter the geonames username.
  4. On "Manage Fields": Add a location selector field to your entity (e.g. Content Type).
  5. On "Manage Form Display": Set the Field Widget parameters.
  6. On "Manage Display": Set the Field Display parameters.

Features

  • Views Integration
    • Add the Location Selector field in the filter section, enter the specific display setting of the field and make the filter exposed.
  • Multiple Languages
    • The locations are displayed in the current user language.
  • Hierarchical Select
    • Select the locations from top to bottom with select lists.
  • Force deepest level
    • Force users to select terms from the deepest level.
  • Save only the last selected element
    • Save only the last selected element and not the parents.
  • Level limitation
    • Choose how many children levels you want to display.
  • Define Basic Parent Location
    • Which locations would you like to make selectable for all? The whole world, a continent, a country or even smaller? Choose for yourself.
  • Link your locations to a custom view
    • Refer your selected locations on the field formatter to a custom view that already includes the field as a filter.

Requirements

Only a free GeoNames User Account is needed (for free). See the How to use section for more information.

How can I help?

Use the module and create Issues for bugs and feedback.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Jul 2023
Latest release
3 months ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
8.x-1.3 Stable 8–11 Jul 7, 2026
8.x-1.2 Stable 8–11 Nov 20, 2024
8.x-1.1 Stable 8–10 Nov 20, 2024
8.x-1.0 Stable Jul 26, 2023