Google Maps and Company Directory

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
faxtion
Forum Members
Forum Members
Posts: 26
Joined: Tue Sep 14, 2010 10:38 am
Location: Dumfries

Google Maps and Company Directory

Post 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?
faxtion
Forum Members
Forum Members
Posts: 26
Joined: Tue Sep 14, 2010 10:38 am
Location: Dumfries

Re: Google Maps and Company Directory

Post 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' }
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm
Location: Colorado

Re: Google Maps and Company Directory

Post by elkman »

Is there a website anywhere that I could view what you've done?
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

Re: Google Maps and Company Directory

Post 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
faxtion
Forum Members
Forum Members
Posts: 26
Joined: Tue Sep 14, 2010 10:38 am
Location: Dumfries

Re: Google Maps and Company Directory

Post by faxtion »

I put the code inside my Template where I would like the google map to appear.
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

Re: Google Maps and Company Directory

Post by pedes »

ok thank you i see it will work now,

thank you very much foor your quick reply

kind regards,
Peter
Post Reply

Return to “Modules/Add-Ons”