I have been looking through all the modules and forums hoping to find that magic combination to simply give me the following...

From my CCK Address Field... I just was to have a simple LINK that inserts the Address into the link so it can point users to google/yahoo map.

I do NOT want to display the map inline... simply a link to the map.
There has to be an easy solution out there.

Thanks.

Comments

neofactor’s picture

I have seen the location module... but it is Beta only, and way overkill. I just want the address to be put into the link.

Like this:
http://maps.google.com/maps?q=1600%20Pennsylvania%20Ave%20NW,%20Washingt...

whitfit’s picture

I was able to accomplish this by placing the following code in a template file for my specific node type (node-hall.tpl.php). The machine field name I used for the CCK address field was halladdress so the variable associated with it is $field_halladdress.

<?php if ($field_halladdress[0] != '') {?>
<a href="http://maps.google.com/maps?q=
<?php print ($field_halladdress[0][street1]);
print " ";
print ($field_halladdress[0][city]);
print " ";
print ($field_halladdress[0][state]);
print " ";
print ($field_halladdress[0][zip]); ?>" target="_blank">Map It!</a><?php }?>
neofactor’s picture

Worked like a champ!
Thanks.

orces’s picture

but it shows Map it only and the address is gone. Is there a way to keep the address showing and having the Map it below? That would be great!