Skip to content
Zotonic
  • Start
  • Cookbook
  • Reference
  • Releases

Live search

Search across all Zotonic content

Type at least two characters

Results are matched against titles, summaries and topics as you type.

Filters · mod_geoip
  • Reference
  • Frontend developer
  • Geolocation
  • Template filter
  • Query
  • Structured data

ip2geo

Module

mod_geoip

Return geographic information associated with an IP address.

The input can be a textual or tuple IP address. The result is a map supplied by the configured GeoIP database, or undefined when the address cannot be located.

For example:

{% with "8.8.8.8"|ip2geo as geo %}
    {{ geo.country.iso_code }}
{% endwith %}

Edit on GitHub

Related documentation

Filters

translated_texts

Check all properties of a map, list or resource. Returns a list of all properties that are translated (have a #trans{} record) and their…

Filters

survey_page_options

Check the list of blocks and collect all options for that page.

Filters

survey_result_column_values

Used by the survey module to add extra column values to the result editor.

Filters

ip2country

Return the lowercase ISO country code associated with an IP address.

Filters

filter_geomap_distance

Calculate the great-circle distance between two locations in kilometers.

Filters

admin_filter_count

Count active filters in admin overview query arguments, for example to display the number of selected filters on the overview's Filter…

Filters

extract

Extract a specific property from each item in a list.

Filters

sum

Sum a list of numbers.

Filters

filter_by

Filter a list of items based on a property value and optional predicate.

GitHub © 2026 Zotonic