Page 1 of 1

Google Maps and Company Directory

Posted: Thu Oct 21, 2010 10:48 am
by faxtion
Hi, I got CGGoogle Maps set up with the Company Directory Module, and I am displaying the companies on the map using the following code

Code: Select all

{CompanyDirectory assign="" detailpage="churchyard-details"} 
{foreach from=$items item='entry'}   
{assign var='name' value=$entry->company_name}
{assign var='address' value=$entry->address}    
{capture assign='description'}
<img src="{$entry->logo_path}" style="float: left;" />
<div style="float: left; margin: 0 0 25px 10px; width: 300px">
<h3>{$entry->company_name}</h3>

<a href="{$entry->detail_url}">Find out more</a>
</div>
{/capture}
{cggm_add_dynpoint map='1' name="$name" address="$address" description="$description"} 
{/foreach}

{CGGoogleMaps map='1' zoom='1' }

Works great, but I am using the system in a slightly different way to its main purpose and its not companies I am listing its churches, and as you may guess not all churches have address's, I want to plot the map using the long/lat co ordinates I specify for each record.

Does any one know if it can be done?

Re: Google Maps and Company Directory

Posted: Thu Oct 21, 2010 11:40 am
by faxtion
solved my problem... Had another look at it... Heres code for anyone who made need it

Code: Select all

{CompanyDirectory assign="" detailpage="churchyard-details"} 
{foreach from=$items item='entry'}   
{assign var='name' value=$entry->company_name}
{assign var='lat' value=$entry->latitude}    
{assign var='long' value=$entry->longitude}    
{capture assign='description'}
<img src="{$entry->logo_path}" />
<h3>{$entry->company_name}</h3>

<a href="{$entry->detail_url}">Find out more</a>
{/capture}
{cggm_add_dynpoint map='1' name="$name" lat="$lat" long="$long" description="$description"} 
{/foreach}

{CGGoogleMaps map='1' zoom='1' }

Re: Google Maps and Company Directory

Posted: Sun Nov 14, 2010 4:43 pm
by elkman
Is there a website anywhere that I could view what you've done?

Re: Google Maps and Company Directory

Posted: Wed Mar 02, 2011 2:17 pm
by pedes
hi there,

can you tell how you exactly managed this ?

where do i put the code and are there any fields i need to create in CompagnyDirectory or a map in CGgoogleMaps.

Please can you explain.

I would really appreciate this.

Thank you very much.
Peter

Re: Google Maps and Company Directory

Posted: Wed Mar 02, 2011 2:22 pm
by faxtion
I put the code inside my Template where I would like the google map to appear.

Re: Google Maps and Company Directory

Posted: Wed Mar 02, 2011 2:32 pm
by pedes
ok thank you i see it will work now,

thank you very much foor your quick reply

kind regards,
Peter