All cities with a store and the number of stores in each, every city linking to its own page (stores/city).
Template
<h1>Our stores</h1>
<ul>
{exp:reinos_maps_locator:regions channel="stores" url="stores/city"}
<li><a href="{region_url}">{region_name}</a> ({region_count})</li>
{/exp:reinos_maps_locator:regions}
</ul>Build it in your own site
What this example needs in ExpressionEngine, step by step.
- Install Maps Locator and Maps.
- Create the field, with these short names:
Short name Type Notes store_locationMaps Set the field setting Mode to Single location: one marker per store, placed with the search field. Maps Locator indexes that marker, so this one field is the location for the map and the search. - Create the channel
stores(Stores) and assign the field. - In the settings of Maps Locator, turn on Reverse geocoding: a marker of a Maps field is saved as a coordinate, the reverse geocoding looks up its address and city (the city pages and a search on a city need them).
- Put the code in the template
stores/cities: the code links to it. - Add a few stores (the demo site has 34 bike stores in the Netherlands).
- Open
/stores/cities.
This example comes from the Maps Locator docs: the preview runs exactly the code above.