Follow ReviewsForJoomla on Twitter
 
Navigation


Integrating Google Maps plugin to listing detail page

From Documentation

Jump to: navigation, search

This article provides a way to add maps to listing detail pages and it is not required to use this 3rd party plugin if you have the GeoMaps add-on. The GeoMaps add-on provides a lot more flexibility like distance searches, custom markers, streetview, the GeoMaps module, etc.

Download the Googlemaps plugin and install it like any other Joomla extension.

After installation, go to Joomla Plugin Manager and make sure Google Maps plugin is ordered after JReviews Comment Plugin with a higher ordering number:

PluginManager.png


Next, edit the Google Maps plugin and enter the Google Maps API key, which you can get here:


You can change other Plugin Preferences, but it is not necessary.


The plugin is now ready to use on listing detail pages.

Before adding JReviews custom fields into plugin code, it is better to test with a hardcoded address to see if the plugin works.

Edit the detail.thtml file and paste this code where you want the map to appear (Usually below SUMMARY/DESCRIPTION).

{mosmap address='11 Wall St, New York, NY 10005, US' | width='550'| height='400'| zoom='15'}


Open one of your listing detail pages and you should see this map:

GoogleMapsPlugin.png

Now just replace the hardcoded address with JReviews custom fields you created:

{mosmap address='<?php echo $CustomFields->field('jr_address',$listing,false);?>,<?php echo $CustomFields->field('jr_city',$listing,false);?>,<?php echo $CustomFields->field('jr_zipcode',$listing,false);?>, <?php echo $CustomFields->field('jr_country',$listing,false);?>' | width='550'| height='400'| zoom='15'}


If all your listings will have the same country, you don't need to use a country custom field, just enter the name of the country.