I thought this would be a pretty simple thing to do given I have the lat / lng stored in a Geofield. However, I'm really struggling.
Basically I just want to show the 20 nearest nodes to the current node in a block.
No address fields or anything complicated, just straightforward coordinates...
Any ideas before I start hacking?!
BTW, I'm a relative Drupal newbie, but lots of PHP experience.
Thanks, Chris
My solution:
$node = menu_get_object(); $value = field_get_items('node', $node, 'field_location'); $lat = $value[0]['lat']; $lon= $value[0]['lon']; return ($lat . ', ' . $lon);
Figured this out from this page https://drupal.org/node/2014345