
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_dataand a manager in the MODX admin - SxGeo (local
.datdatabase, 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
| Requirement | Version |
|---|---|
| MODX Revolution | 3.0+ |
| PHP | 8.2+ |
Installation
- Connect ModStore.
- Extras → Installer → Download Extras — GeoLocation2 → Download → Install.
- Manage → Clear cache.
- Open Components → GeoLocation2 and check catalog tabs.
- Confirm SxGeo file exists:
assets/components/geolocation2/vendor/sypexgeo/data/SxGeoCity.dat. - Add snippets to the site — see Quick start.
Package catalog: modstore.pro. Source: GitHub.
Quick links
| Section | Description |
|---|---|
| Quick start | Minimal site setup |
| System settings | geolocation2_* keys |
| Integration | Manager, data model, CSV, PHP service, SxGeo |
| Web API | GET/POST action.php |
| Snippets | Parameters and chunks |
| FAQ | Common issues |
