hi,
i am trying to access location data (lat/lon) from cck computed field

which is the proper syntax?

i tried out the following without success:

$node->locations[0]['latitude']['value']
$node->locations[0]['lat']['value']
$node->locations[0]['latitude']
$node->locations[0]['lat']
$node->locations['latitude']
$node->locations['lat']
$node->locations['latitude']['value']
$node->locations['lat']['value']

$node->location[0]['latitude']['value']
$node->location[0]['lat']['value']
$node->location[0]['latitude']
$node->location[0]['lat']
$node->location['latitude']
$node->location['lat']
$node->location['latitude']['value']
$node->location['lat']['value']

an empty string is returned...

i noticed that when location is used in blocks, load_load() is called,
however this function cannot be used inside computed field because node data is already loaded in $node and page crashes if used...

any help???

thanks!

Comments

jimkont’s picture

this is how i finally made it work

$loc = location_load_locations('node', $node);
print $loc['locations'][0]['lat'];
yesct’s picture

Status: Active » Fixed

Looks like the poster solved their problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bneel’s picture

Hi,
I want to change lat and long data coming from the location module.
I want to do this with computed field.
Ca you explain how did your get de data into the computed field. I tried you code, but it did't work for ma. I don't know what is wrong.
Thx