Skip to content
  1. Extras
  2. GeoLocation2
  3. Snippets
  4. GeoLocation2

GeoLocation2

Lists active cities from gl_cities. Each row is one chunk pass. Does not touch session or modal: static catalog for menus or sitemaps.

Parameters

ParameterDefaultDescription
tpltpl.GeoLocation2.itemRow chunk
sortbyname_ruSort field
sortdirASCASC or DESC
limit10Max rows; 0 = all active
region_id(empty)Filter by gl_regions.id
outputSeparatornewlineBetween rows
toPlaceholder(empty)Placeholder instead of output

Call

modx
[[!GeoLocation2]]
[[!GeoLocation2? &limit=`0`]]
[[!GeoLocation2? &region_id=`5`]]
fenom
{'!GeoLocation2' | snippet : ['limit' => 0, 'region_id' => 5]}

Output example

Default chunk for two cities:

html
<p><strong>Moscow</strong> Moscow — region id: 1 55.7558 37.6173</p>
<p><strong>Kazan</strong> Kazan — region id: 2 55.7963 49.1088</p>

Row placeholders are GlCity fields: id, name_ru, name_en, region_id, lat, lon, etc.

vs modal

GeoLocation2GeoLocation2Modal
Sourcegl_cities onlySession + SxGeo + search API
Page cacheList can be cached separatelyModal/Initialize must be uncached
City pickNoYes

See GeoLocation2Modal.