Skip to content
  1. Extras
  2. GeoLocation2

GeoLocation2

Country, region and city catalog in gl_* tables, IP lookup via SxGeo, front-end city picker (Bootstrap 5 modal) and REST endpoint action.php.

Features

  • Tables gl_countries, gl_regions, gl_cities, gl_data and a manager in the MODX admin
  • SxGeo (local .dat database, no external API on every request)
  • Session $_SESSION['gl2']: selected city, confirmed flag, CSRF token
  • Snippets for city lists, SxGeo lookup, gl_data, modal flow
  • CSV import/export from the manager
  • Optional Scheduler task for SxGeo auto-update

Requirements

RequirementVersion
MODX Revolution3.0+
PHP8.2+

Installation

  1. Connect ModStore.
  2. Extras → InstallerDownload ExtrasGeoLocation2DownloadInstall.
  3. Manage → Clear cache.
  4. Open Components → GeoLocation2 and check catalog tabs.
  5. Confirm SxGeo file exists: assets/components/geolocation2/vendor/sypexgeo/data/SxGeoCity.dat.
  6. Add snippets to the site — see Quick start.

Package catalog: modstore.pro. Source: GitHub.

SectionDescription
Quick startMinimal site setup
System settingsgeolocation2_* keys
IntegrationManager, data model, CSV, PHP service, SxGeo
Web APIGET/POST action.php
SnippetsParameters and chunks
FAQCommon issues