Blog Sections Open

Saving Yandex Geocoder Coordinates into a TV in Evolution CMS

How to geocode an address with Yandex and save the resulting coordinates directly into a TV in Evolution CMS.

If editors enter addresses manually, sooner or later somebody wants those addresses turned into map coordinates without copying and pasting latitude and longitude by hand. This pattern solves that by taking an address, sending it to the Yandex geocoder, and saving the returned point into a TV.

The original snippet used three inputs:

  • &addTv for the destination TV name;
  • &adress for the street or address line;
  • &city for the city prefix, which improves geocoding accuracy.

A typical call looked like this:

[[!adressToPos?
  &addTv=`maps`
  &adress=`[[*Adress]]`
  &city=`[[*City]]`
]]

The snippet then requested the Yandex geocoder API, extracted the first matching point, and wrote it into the selected TV with setTVValue(). That makes the workflow editor-friendly: the content team keeps filling in addresses, while the site keeps a machine-readable coordinates field for maps, listings, and exports.

This is a good example of the Evolution way of solving problems: keep the manager input simple, enrich the data at save or render time, and store the output in a place the rest of the project can reuse.

If you adapt the pattern today, add error handling and rate-limit awareness, but the core idea remains solid.

Newer post

Generating PDF Versions of Evolution CMS Resources with TCPDF

A practical pattern for rendering an Evolution CMS resource as HTML or exporting the same content as a PDF through TCPDF.

Older post

Keeping Ditto Summary Output Clean When News Starts with Images or Heavy HTML

How to make Ditto summaries behave when introtext begins with images or contains markup that should not leak into listing excerpts.