Skip to content

Instantly share code, notes, and snippets.

@favrik
Created June 8, 2012 13:11
Show Gist options
  • Save favrik/2895534 to your computer and use it in GitHub Desktop.
Save favrik/2895534 to your computer and use it in GitHub Desktop.
template.html
{embed="_includes/.html-header" title="Search Results for: {exp:search:keywords}"}
{embed="_includes/.main-page-images"}
<div class="main-column-left">
<h1 class="main-page-title">Interactive Map Search Results for: <em>{exp:search:keywords}</em></h1>
{exp:gmap:init id="map" class="gmap" style="width:100%;height:200px"}
{exp:gmap:results order_by="distance" sort="asc" parse="inward" show_sql="true"}
{if has_searched}
<ul>
{results}
<li>{title} {entry_title} {url_title} - {distance} miles</li>
{/results}
</ul>
{results}
{exp:gmap:marker id="map" latitude="{latitude}" longitude="{longitude}"}
{/results}
{if:else}
{exp:channel:entries channel="interactive-map" dynamic="no" disable="member_data|categories|category_fields|pagination" parse="inward"}
{location-map id="map"}
{/exp:channel:entries}
{/if}
{if no_results}
<p>No results found</p>
{exp:channel:entries channel="interactive-map" dynamic="no" disable="member_data|categories|category_fields|pagination" parse="inward"}
{location-map id="map"}
{/exp:channel:entries}
{/if}
{/exp:gmap:results}
<h3><a href="{site_url}interactive-map">&laquo; Return to the Interactive Map</a></h3>
</div><!-- ends .main-column-left -->
{embed="_includes/.right-nav" start_on="visiting"}
{embed="interactive-map/.categories"}
{embed="_includes/.html-footer"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment